aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-09-01 23:57:27 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2017-09-01 23:57:27 -0400
commitd0d6ab53c9abd7dd1070f43a0455328874127ba8 (patch)
treec856b06963c2a8ae0c312f012ec3d740e89c07d0
parent54f70f52e3b3a26164220d98a712a274bd28502f (diff)
parent7e682f766f289887c5cbf7c0a1e4970103f01ac4 (diff)
Merge branch 'for-next' of git://git.samba.org/sfrench/cifs-2.6
Pull cifs version warning fix from Steve French: "As requested, additional kernel warning messages to clarify the default dialect changes" [ There is still some discussion about exactly which version should be the new default. Longer-term we have auto-negotiation coming, but that's not there yet.. - Linus ] * 'for-next' of git://git.samba.org/sfrench/cifs-2.6: Fix warning messages when mounting to older servers
-rw-r--r--fs/cifs/connect.c22
-rw-r--r--fs/cifs/smb2pdu.c7
2 files changed, 27 insertions, 2 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index 59647eb72c5f..83a8f52cd879 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -1223,6 +1223,7 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
1223 char *tmp_end, *value; 1223 char *tmp_end, *value;
1224 char delim; 1224 char delim;
1225 bool got_ip = false; 1225 bool got_ip = false;
1226 bool got_version = false;
1226 unsigned short port = 0; 1227 unsigned short port = 0;
1227 struct sockaddr *dstaddr = (struct sockaddr *)&vol->dstaddr; 1228 struct sockaddr *dstaddr = (struct sockaddr *)&vol->dstaddr;
1228 1229
@@ -1874,24 +1875,35 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
1874 pr_warn("CIFS: server netbiosname longer than 15 truncated.\n"); 1875 pr_warn("CIFS: server netbiosname longer than 15 truncated.\n");
1875 break; 1876 break;
1876 case Opt_ver: 1877 case Opt_ver:
1878 /* version of mount userspace tools, not dialect */
1877 string = match_strdup(args); 1879 string = match_strdup(args);
1878 if (string == NULL) 1880 if (string == NULL)
1879 goto out_nomem; 1881 goto out_nomem;
1880 1882
1883 /* If interface changes in mount.cifs bump to new ver */
1881 if (strncasecmp(string, "1", 1) == 0) { 1884 if (strncasecmp(string, "1", 1) == 0) {
1885 if (strlen(string) > 1) {
1886 pr_warn("Bad mount helper ver=%s. Did "
1887 "you want SMB1 (CIFS) dialect "
1888 "and mean to type vers=1.0 "
1889 "instead?\n", string);
1890 goto cifs_parse_mount_err;
1891 }
1882 /* This is the default */ 1892 /* This is the default */
1883 break; 1893 break;
1884 } 1894 }
1885 /* For all other value, error */ 1895 /* For all other value, error */
1886 pr_warn("CIFS: Invalid version specified\n"); 1896 pr_warn("CIFS: Invalid mount helper version specified\n");
1887 goto cifs_parse_mount_err; 1897 goto cifs_parse_mount_err;
1888 case Opt_vers: 1898 case Opt_vers:
1899 /* protocol version (dialect) */
1889 string = match_strdup(args); 1900 string = match_strdup(args);
1890 if (string == NULL) 1901 if (string == NULL)
1891 goto out_nomem; 1902 goto out_nomem;
1892 1903
1893 if (cifs_parse_smb_version(string, vol) != 0) 1904 if (cifs_parse_smb_version(string, vol) != 0)
1894 goto cifs_parse_mount_err; 1905 goto cifs_parse_mount_err;
1906 got_version = true;
1895 break; 1907 break;
1896 case Opt_sec: 1908 case Opt_sec:
1897 string = match_strdup(args); 1909 string = match_strdup(args);
@@ -1973,6 +1985,14 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
1973 else if (override_gid == 1) 1985 else if (override_gid == 1)
1974 pr_notice("CIFS: ignoring forcegid mount option specified with no gid= option.\n"); 1986 pr_notice("CIFS: ignoring forcegid mount option specified with no gid= option.\n");
1975 1987
1988 if (got_version == false)
1989 pr_warn("No dialect specified on mount. Default has changed to "
1990 "a more secure dialect, SMB3 (vers=3.0), from CIFS "
1991 "(SMB1). To use the less secure SMB1 dialect to access "
1992 "old servers which do not support SMB3 specify vers=1.0"
1993 " on mount. For somewhat newer servers such as Windows "
1994 "7 try vers=2.1.\n");
1995
1976 kfree(mountdata_copy); 1996 kfree(mountdata_copy);
1977 return 0; 1997 return 0;
1978 1998
diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
index 97edb4d376cd..7aa67206f6da 100644
--- a/fs/cifs/smb2pdu.c
+++ b/fs/cifs/smb2pdu.c
@@ -514,7 +514,12 @@ SMB2_negotiate(const unsigned int xid, struct cifs_ses *ses)
514 * No tcon so can't do 514 * No tcon so can't do
515 * cifs_stats_inc(&tcon->stats.smb2_stats.smb2_com_fail[SMB2...]); 515 * cifs_stats_inc(&tcon->stats.smb2_stats.smb2_com_fail[SMB2...]);
516 */ 516 */
517 if (rc != 0) 517 if (rc == -EOPNOTSUPP) {
518 cifs_dbg(VFS, "Dialect not supported by server. Consider "
519 "specifying vers=1.0 or vers=2.1 on mount for accessing"
520 " older servers\n");
521 goto neg_exit;
522 } else if (rc != 0)
518 goto neg_exit; 523 goto neg_exit;
519 524
520 cifs_dbg(FYI, "mode 0x%x\n", rsp->SecurityMode); 525 cifs_dbg(FYI, "mode 0x%x\n", rsp->SecurityMode);