summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Aurich <paul@darkrain42.org>2024-11-08 14:29:06 -0800
committerSteve French <stfrench@microsoft.com>2024-11-10 22:50:38 -0600
commit85885a5990eaa4088fb00bb6d022a43d298bf6c5 (patch)
tree0c8e9e77cc379513952a74c0064862b0a951cfbf
parente6054a2024c888391aff754fced5af18ff0efc81 (diff)
downloadlinux-85885a5990eaa4088fb00bb6d022a43d298bf6c5.tar.gz
linux-85885a5990eaa4088fb00bb6d022a43d298bf6c5.tar.bz2
linux-85885a5990eaa4088fb00bb6d022a43d298bf6c5.zip
smb: During umount, flush any pending lease breaks for cached dirs
*** WORK IN PROGRESS *** If a lease break is received right as a filesystem is being unmounted, it's possible for cifs_kill_sb() to race with a queued smb2_cached_lease_break(). Since the cfid is no longer on the cfids->entries list, close_all_cached_dirs() cannot drop the dentry, leading to the unmount to report these BUGs: BUG: Dentry ffff88814f37e358{i=1000000000080,n=/} still in use (2) [unmount of cifs cifs] VFS: Busy inodes after unmount of cifs (cifs) ------------[ cut here ]------------ kernel BUG at fs/super.c:661! Flush anything in the cifsiod_wq workqueue in close_all_cached_dirs. Fixes: ebe98f1447bb ("cifs: enable caching of directories for which a lease is held") Cc: stable@vger.kernel.org Signed-off-by: Paul Aurich <paul@darkrain42.org> Signed-off-by: Steve French <stfrench@microsoft.com>
-rw-r--r--fs/smb/client/cached_dir.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/smb/client/cached_dir.c b/fs/smb/client/cached_dir.c
index de1e41abdaf2..931108b3bb4a 100644
--- a/fs/smb/client/cached_dir.c
+++ b/fs/smb/client/cached_dir.c
@@ -484,6 +484,9 @@ void close_all_cached_dirs(struct cifs_sb_info *cifs_sb)
cfid->dentry = NULL;
}
}
+
+ /* Flush any pending lease breaks */
+ flush_workqueue(cifsiod_wq);
}
/*