Skip to content

Commit 0e314e4

Browse files
author
Steve French
committed
cifs: mount with "unix" mount option for SMB1 incorrectly handled
Although by default we negotiate CIFS Unix Extensions for SMB1 mounts to Samba (and they work if the user does not specify "unix" or "posix" or "linux" on mount), and we do properly handle when a user turns them off with "nounix" mount parm. But with the changes to the mount API we broke cases where the user explicitly specifies the "unix" option (or equivalently "linux" or "posix") on mount with vers=1.0 to Samba or other servers which support the CIFS Unix Extensions. "mount error(95): Operation not supported" and logged: "CIFS: VFS: Check vers= mount option. SMB3.11 disabled but required for POSIX extensions" even though CIFS Unix Extensions are supported for vers=1.0 This patch fixes the case where the user specifies both "unix" (or equivalently "posix" or "linux") and "vers=1.0" on mount to a server which supports the CIFS Unix Extensions. Cc: stable@vger.kernel.org Reviewed-by: David Howells <dhowell@redhat.com> Reviewed-by: Paulo Alcantara (Red Hat) <pc@manguebit.com> Signed-off-by: Steve French <stfrench@microsoft.com>
1 parent a214384 commit 0e314e4

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

fs/smb/client/connect.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2614,6 +2614,13 @@ cifs_get_tcon(struct cifs_ses *ses, struct smb3_fs_context *ctx)
26142614
cifs_dbg(VFS, "Server does not support mounting with posix SMB3.11 extensions\n");
26152615
rc = -EOPNOTSUPP;
26162616
goto out_fail;
2617+
} else if (ses->server->vals->protocol_id == SMB10_PROT_ID)
2618+
if (cap_unix(ses))
2619+
cifs_dbg(FYI, "Unix Extensions requested on SMB1 mount\n");
2620+
else {
2621+
cifs_dbg(VFS, "SMB1 Unix Extensions not supported by server\n");
2622+
rc = -EOPNOTSUPP;
2623+
goto out_fail;
26172624
} else {
26182625
cifs_dbg(VFS,
26192626
"Check vers= mount option. SMB3.11 disabled but required for POSIX extensions\n");

0 commit comments

Comments
 (0)