diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index d096cfda56eb5f56f22cb17f8b2f35e50f5d2ca7..3a9980bf0d6ee9e1482dc062bee56046722b573d 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);