[linux-cifs-client] [PATCH 0/4] cifs: fix deadlocks, oopses and mem corruption with concurrent mount/umount (try #2)

Jeff Layton jlayton at redhat.com
Sun Oct 12 13:55:04 GMT 2008


This patchset is intended to fix the deadlocks, oopses, memory
corruption and mount failures when using the reproducer detailed here:

https://bugzilla.samba.org/show_bug.cgi?id=5720

This is the second attempt at this. Steve had reservations about the
first patchset since it would have broken multiuser mounts, and may
have had implications for the DebugData procfile.

It starts by disabling the sharing of server, session and tcon structs.
It then removes kthread_stop from the cifsd shutdown codepath. This
eliminates the deadlocks seen with it. It then adds some cleanup of the
cifsd shutdown code to close races there, and finally re-enables the
sharing of TCP sessions.

While I haven't tested it, this should allow the multiuser mount code to
continue working since that doesn't require sharing anything besides TCP
sessions. I've left the sharing of SMB sessions and tcons for another
day. It certainly wouldn't hurt to eventually put that back, but
cleaning up the refcounting there involves a substantial amount of code
change. It's probably prudent to draw a line here and build on top of
this patchset.

With this, I've been able to run the reproducer in the above BZ
overnight, whereas before it would regularly crash after just a few
minutes.

Signed-off-by: Jeff Layton <jlayton at redhat.com>

Jeff Layton (4):
  cifs: disable sharing of server, session and tcon
  cifs: eliminate usage of kthread_stop for cifsd
  cifs: handle the TCP_Server_Info->tsk field more carefully
  cifs: add global TCP session list and reenable TCP session sharing

 fs/cifs/cifs_debug.c |    2 +-
 fs/cifs/cifsfs.c     |    8 ++
 fs/cifs/cifsglob.h   |    5 +-
 fs/cifs/cifsproto.h  |    1 +
 fs/cifs/cifssmb.c    |   14 +--
 fs/cifs/connect.c    |  229 ++++++++++++++++++--------------------------------
 6 files changed, 100 insertions(+), 159 deletions(-)



More information about the linux-cifs-client mailing list