]> git.baikalelectronics.ru Git - kernel.git/commit
cifs: don't call mid_q_entry->callback under the Global_MidLock (try #5)
authorJeff Layton <jlayton@redhat.com>
Sun, 22 May 2011 11:09:13 +0000 (07:09 -0400)
committerSteve French <sfrench@us.ibm.com>
Tue, 24 May 2011 03:11:33 +0000 (03:11 +0000)
commit9b7d5d35f2a78b897dd15b3ee0c2b49c5fd31d5e
treebfbcfaaae2fdfd16b2fcdb57710b9affbf183c49
parenta8af600dad905acfff6e8e4c291f1c0dc01d31ef
cifs: don't call mid_q_entry->callback under the Global_MidLock (try #5)

Minor revision to the last version of this patch -- the only difference
is the fix to the cFYI statement in cifs_reconnect.

Holding the spinlock while we call this function means that it can't
sleep, which really limits what it can do. Taking it out from under
the spinlock also means less contention for this global lock.

Change the semantics such that the Global_MidLock is not held when
the callback is called. To do this requires that we take extra care
not to have sync_mid_result remove the mid from the list when the
mid is in a state where that has already happened. This prevents
list corruption when the mid is sitting on a private list for
reconnect or when cifsd is coming down.

Reviewed-by: Shirish Pargaonkar <shirishpargaonkar@gmail.com>
Reviewed-by: Pavel Shilovsky <piastry@etersoft.ru>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
fs/cifs/cifsglob.h
fs/cifs/connect.c
fs/cifs/transport.c