Skip to content

Commit

Permalink
[CIFS] remove bkl usage from umount begin
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Steve French committed Jun 26, 2009
1 parent 0f3bc09 commit ad8034f
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions fs/cifs/cifsfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -537,9 +537,14 @@ static void cifs_umount_begin(struct super_block *sb)
if (tcon == NULL)
return;

lock_kernel();
read_lock(&cifs_tcp_ses_lock);
if (tcon->tc_count == 1)
if ((tcon->tc_count > 1) || (tcon->tidStatus == CifsExiting)) {
/* we have other mounts to same share or we have
already tried to force umount this and woken up
all waiting network requests, nothing to do */
read_unlock(&cifs_tcp_ses_lock);
return;
} else if (tcon->tc_count == 1)
tcon->tidStatus = CifsExiting;
read_unlock(&cifs_tcp_ses_lock);

Expand All @@ -554,9 +559,7 @@ static void cifs_umount_begin(struct super_block *sb)
wake_up_all(&tcon->ses->server->response_q);
msleep(1);
}
/* BB FIXME - finish add checks for tidStatus BB */

unlock_kernel();
return;
}

Expand Down

0 comments on commit ad8034f

Please sign in to comment.