summaryrefslogtreecommitdiffstats
path: root/fs/smb/client/connect.c
diff options
context:
space:
mode:
authorSteve French <stfrench@microsoft.com>2023-09-19 11:35:53 -0500
committerSteve French <stfrench@microsoft.com>2023-09-19 13:32:02 -0500
commit2da338ff752a2789470d733111a5241f30026675 (patch)
tree06b78b25341ba966454dc9a641c825e5f42abf80 /fs/smb/client/connect.c
parente3603ccf4a35fdf433ee7b60bb7cfb598f19c8fa (diff)
downloadlinux-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/connect.c')
-rw-r--r--fs/smb/client/connect.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/smb/client/connect.c b/fs/smb/client/connect.c
index 687754791bf0..3902e90dca6b 100644
--- a/fs/smb/client/connect.c
+++ b/fs/smb/client/connect.c
@@ -1882,7 +1882,8 @@ cifs_setup_ipc(struct cifs_ses *ses, struct smb3_fs_context *ctx)
}
}
- tcon = tconInfoAlloc();
+ /* no need to setup directory caching on IPC share, so pass in false */
+ tcon = tcon_info_alloc(false);
if (tcon == NULL)
return -ENOMEM;
@@ -2492,7 +2493,10 @@ cifs_get_tcon(struct cifs_ses *ses, struct smb3_fs_context *ctx)
goto out_fail;
}
- tcon = tconInfoAlloc();
+ if (ses->server->capabilities & SMB2_GLOBAL_CAP_DIRECTORY_LEASING)
+ tcon = tcon_info_alloc(true);
+ else
+ tcon = tcon_info_alloc(false);
if (tcon == NULL) {
rc = -ENOMEM;
goto out_fail;