diff options
Diffstat (limited to 'fs/cifs')
-rw-r--r-- | fs/cifs/cifsfs.c | 11 |
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 | ||