summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorSteve French <stfrench@microsoft.com>2020-10-21 07:15:42 +0200
committerSteve French <stfrench@microsoft.com>2020-10-22 00:57:07 +0200
commit3c6e65e679182d55779ef6f8582f0945af4319b0 (patch)
treed20ad78e56e3651b5b527707d113b908c15ab35f /fs
parentsmb3: fix stat when special device file and mounted with modefromsid (diff)
downloadlinux-3c6e65e679182d55779ef6f8582f0945af4319b0.tar.xz
linux-3c6e65e679182d55779ef6f8582f0945af4319b0.zip
smb3: do not try to cache root directory if dir leases not supported
To servers which do not support directory leases (e.g. Samba) it is wasteful to try to open_shroot (ie attempt to cache the root directory handle). Skip attempt to open_shroot when server does not indicate support for directory leases. Cuts the number of requests on mount from 17 to 15, and cuts the number of requests on stat of the root directory from 4 to 3. Signed-off-by: Steve French <stfrench@microsoft.com> CC: Stable <stable@vger.kernel.org> # v5.1+
Diffstat (limited to 'fs')
-rw-r--r--fs/cifs/connect.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index d096cfda56eb..3a9980bf0d6e 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -3608,7 +3608,10 @@ cifs_get_tcon(struct cifs_ses *ses, struct smb_vol *volume_info)
*/
tcon->retry = volume_info->retry;
tcon->nocase = volume_info->nocase;
- tcon->nohandlecache = volume_info->nohandlecache;
+ if (ses->server->capabilities & SMB2_GLOBAL_CAP_DIRECTORY_LEASING)
+ tcon->nohandlecache = volume_info->nohandlecache;
+ else
+ tcon->nohandlecache = 1;
tcon->nodelete = volume_info->nodelete;
tcon->local_lease = volume_info->local_lease;
INIT_LIST_HEAD(&tcon->pending_opens);