mapchars should be default on smb2 and later mounts

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Since we don't have posix pathnames in SMB2/SMB3, shouldn't mapchars
be the default if unspecified at mount to smb2/smb3 server?

diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index 8813ff7..cc24459 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -1197,6 +1197,7 @@ cifs_parse_mount_options(const char *mountdata,
const char *devname,
     short int override_gid = -1;
     bool uid_specified = false;
     bool gid_specified = false;
+    bool mapchar_specified = false;
     bool sloppy = false;
     char *invalid = NULL;
     char *nodename = utsname()->nodename;
@@ -1339,9 +1340,11 @@ cifs_parse_mount_options(const char *mountdata,
const char *devname,
             break;
         case Opt_mapchars:
             vol->remap = 1;
+            mapchar_specified = true;
             break;
         case Opt_nomapchars:
             vol->remap = 0;
+            mapchar_specified = true;
             break;
         case Opt_sfu:
             vol->sfu_emul = 1;
@@ -1882,6 +1885,10 @@ cifs_parse_mount_options(const char *mountdata,
const char *devname,
         printk(KERN_NOTICE "CIFS: ignoring forcegid mount option "
                    "specified with no gid= option.\n");

+    /* SMB2 and later do not support posix pathnames. default to mapchar */
+    if ((mapchar_specified == false) && (vol->vals != &smb1_values))
+        vol->remap = 1;
+
     kfree(mountdata_copy);
     return 0;

-- 
Thanks,

Steve
--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux