diff options
author | Kenneth D'souza <kdsouza@redhat.com> | 2020-05-18 09:31:34 +0200 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2020-06-01 07:10:17 +0200 |
commit | 8fd6e1d6941ce623ae62420d264c1b5505971b2b (patch) | |
tree | 3653d543b948323eb5da0a61447bc64a89a89ac3 /fs | |
parent | Linux 5.7 (diff) | |
download | linux-8fd6e1d6941ce623ae62420d264c1b5505971b2b.tar.xz linux-8fd6e1d6941ce623ae62420d264c1b5505971b2b.zip |
cifs: handle "nolease" option for vers=1.0
The "nolease" mount option is only supported for SMB2+ mounts.
Fail with appropriate error message if vers=1.0 option is passed.
Signed-off-by: Kenneth D'souza <kdsouza@redhat.com>
Reviewed-by: Pavel Shilovsky <pshilov@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/cifs/connect.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 28268ed461b8..62503fbed2ab 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -3580,6 +3580,16 @@ cifs_get_tcon(struct cifs_ses *ses, struct smb_vol *volume_info) cifs_dbg(VFS, "cache=singleclient requested on mount but NO_CACHING flag set on share\n"); } + if (volume_info->no_lease) { + if (ses->server->vals->protocol_id == 0) { + cifs_dbg(VFS, + "SMB2 or later required for nolease option\n"); + rc = -EOPNOTSUPP; + goto out_fail; + } else + tcon->no_lease = volume_info->no_lease; + } + /* * We can have only one retry value for a connection to a share so for * resources mounted more than once to the same server share the last @@ -3589,7 +3599,6 @@ cifs_get_tcon(struct cifs_ses *ses, struct smb_vol *volume_info) tcon->nocase = volume_info->nocase; tcon->nohandlecache = volume_info->nohandlecache; tcon->local_lease = volume_info->local_lease; - tcon->no_lease = volume_info->no_lease; INIT_LIST_HEAD(&tcon->pending_opens); spin_lock(&cifs_tcp_ses_lock); |