Skip to content

Commit d0cbe56

Browse files
committed
[smb3] improve error message when mount options conflict with posix
POSIX extensions require SMB3.1.1 (so improve the error message when vers=3.0, 2.1 or 2.0 is specified on mount) Signed-off-by: Steve French <[email protected]>
1 parent dfd42fa commit d0cbe56

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

fs/cifs/connect.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2340,10 +2340,19 @@ cifs_get_tcon(struct cifs_ses *ses, struct smb3_fs_context *ctx)
23402340
if (ses->server->posix_ext_supported) {
23412341
tcon->posix_extensions = true;
23422342
pr_warn_once("SMB3.11 POSIX Extensions are experimental\n");
2343-
} else {
2343+
} else if ((ses->server->vals->protocol_id == SMB311_PROT_ID) ||
2344+
(strcmp(ses->server->vals->version_string,
2345+
SMB3ANY_VERSION_STRING) == 0) ||
2346+
(strcmp(ses->server->vals->version_string,
2347+
SMBDEFAULT_VERSION_STRING) == 0)) {
23442348
cifs_dbg(VFS, "Server does not support mounting with posix SMB3.11 extensions\n");
23452349
rc = -EOPNOTSUPP;
23462350
goto out_fail;
2351+
} else {
2352+
cifs_dbg(VFS, "Check vers= mount option. SMB3.11 "
2353+
"disabled but required for POSIX extensions\n");
2354+
rc = -EOPNOTSUPP;
2355+
goto out_fail;
23472356
}
23482357
}
23492358

0 commit comments

Comments
 (0)