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)
commit3c1105df699188a70f5c17dc0795affea388bca7
treebfbcfaaae2fdfd16b2fcdb57710b9affbf183c49
parent724d9f1cfba0cb16a7151333b501e8f7885450d8
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