aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/cifsfs.c
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2009-06-25 23:25:49 -0400
committerSteve French <sfrench@us.ibm.com>2009-06-25 23:25:49 -0400
commitad8034f19792736db5c259103c2eaaf72887bbb4 (patch)
treead631c38d2d66c6d3ca57cdae471560461cec119 /fs/cifs/cifsfs.c
parent0f3bc09ee1b7fcadd5bfdc5ed2e1643f658fe23d (diff)
[CIFS] remove bkl usage from umount begin
The lock_kernel call moved into the fs for umount_begin is not needed. This adds a check to make sure we don't call umount_begin twice on the same fs. umount_begin for cifs is probably not needed and may eventually be able to be removed, but in the meantime this smaller patch is safe and gets rid of the bkl from this path which provides some benefit. Acked-by: Jeff Layton <redhat.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/cifsfs.c')
-rw-r--r--fs/cifs/cifsfs.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index b5e9f398c2e5..9f669f982c4d 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -537,9 +537,14 @@ static void cifs_umount_begin(struct super_block *sb)
537 if (tcon == NULL) 537 if (tcon == NULL)
538 return; 538 return;
539 539
540 lock_kernel();
541 read_lock(&cifs_tcp_ses_lock); 540 read_lock(&cifs_tcp_ses_lock);
542 if (tcon->tc_count == 1) 541 if ((tcon->tc_count > 1) || (tcon->tidStatus == CifsExiting)) {
542 /* we have other mounts to same share or we have
543 already tried to force umount this and woken up
544 all waiting network requests, nothing to do */
545 read_unlock(&cifs_tcp_ses_lock);
546 return;
547 } else if (tcon->tc_count == 1)
543 tcon->tidStatus = CifsExiting; 548 tcon->tidStatus = CifsExiting;
544 read_unlock(&cifs_tcp_ses_lock); 549 read_unlock(&cifs_tcp_ses_lock);
545 550
@@ -554,9 +559,7 @@ static void cifs_umount_begin(struct super_block *sb)
554 wake_up_all(&tcon->ses->server->response_q); 559 wake_up_all(&tcon->ses->server->response_q);
555 msleep(1); 560 msleep(1);
556 } 561 }
557/* BB FIXME - finish add checks for tidStatus BB */
558 562
559 unlock_kernel();
560 return; 563 return;
561} 564}
562 565