Skip to content

Commit 3c6e65e

Browse files
committed
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+
1 parent 3c3317d commit 3c6e65e

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

fs/cifs/connect.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3608,7 +3608,10 @@ cifs_get_tcon(struct cifs_ses *ses, struct smb_vol *volume_info)
36083608
*/
36093609
tcon->retry = volume_info->retry;
36103610
tcon->nocase = volume_info->nocase;
3611-
tcon->nohandlecache = volume_info->nohandlecache;
3611+
if (ses->server->capabilities & SMB2_GLOBAL_CAP_DIRECTORY_LEASING)
3612+
tcon->nohandlecache = volume_info->nohandlecache;
3613+
else
3614+
tcon->nohandlecache = 1;
36123615
tcon->nodelete = volume_info->nodelete;
36133616
tcon->local_lease = volume_info->local_lease;
36143617
INIT_LIST_HEAD(&tcon->pending_opens);

0 commit comments

Comments
 (0)