diff options
author | Steve French <stfrench@microsoft.com> | 2023-09-19 11:35:53 -0500 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2023-09-19 13:32:02 -0500 |
commit | 2da338ff752a2789470d733111a5241f30026675 (patch) | |
tree | 06b78b25341ba966454dc9a641c825e5f42abf80 /fs/smb/client/cached_dir.c | |
parent | e3603ccf4a35fdf433ee7b60bb7cfb598f19c8fa (diff) | |
download | linux-stable-2da338ff752a2789470d733111a5241f30026675.tar.gz linux-stable-2da338ff752a2789470d733111a5241f30026675.tar.bz2 linux-stable-2da338ff752a2789470d733111a5241f30026675.zip |
smb3: do not start laundromat thread when dir leases
disabled
When no directory lease support, or for IPC shares where directories
can not be opened, do not start an unneeded laundromat thread for
that mount (it wastes resources).
Fixes: d14de8067e3f ("cifs: Add a laundromat thread for cached directories")
Reviewed-by: Paulo Alcantara (SUSE) <pc@manguebit.com>
Acked-by: Tom Talpey <tom@talpey.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/smb/client/cached_dir.c')
-rw-r--r-- | fs/smb/client/cached_dir.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/smb/client/cached_dir.c b/fs/smb/client/cached_dir.c index b17f067e4ada..e2be8aedb26e 100644 --- a/fs/smb/client/cached_dir.c +++ b/fs/smb/client/cached_dir.c @@ -452,6 +452,9 @@ void invalidate_all_cached_dirs(struct cifs_tcon *tcon) struct cached_fid *cfid, *q; LIST_HEAD(entry); + if (cfids == NULL) + return; + spin_lock(&cfids->cfid_list_lock); list_for_each_entry_safe(cfid, q, &cfids->entries, entry) { list_move(&cfid->entry, &entry); @@ -651,6 +654,9 @@ void free_cached_dirs(struct cached_fids *cfids) struct cached_fid *cfid, *q; LIST_HEAD(entry); + if (cfids == NULL) + return; + if (cfids->laundromat) { kthread_stop(cfids->laundromat); cfids->laundromat = NULL; |