cifs: map NT_STATUS_ERROR_WRITE_PROTECTED to -EROFS
Subsystems (2)
PATCH 1/2 cifs: map NT_STATUS_ERROR_WRITE_PROTECTED to -EROFS
Seems like a more sensible mapping than -EIO.
--- fs/cifs/netmisc.c | 1 + fs/cifs/smberr.h | 1 + 2 files changed, 2 insertions(+), 0 deletions(-)
fs/cifs/netmisc.c +1 -0
@@ -61,6 +61,7 @@ static const struct smb_to_posix_error mapping_table_ERRDOS[] = { {ERRremcd, -EACCES}, {ERRdiffdevice, -EXDEV}, {ERRnofiles, -ENOENT}, + {ERRwriteprot, -EROFS}, {ERRbadshare, -ETXTBSY}, {ERRlock, -EACCES}, {ERRunsup, -EINVAL},
fs/cifs/smberr.h +1 -0
@@ -76,6 +76,7 @@#define ERRnofiles 18/* A File Search command can find no more files matching the specified criteria. */ +#define ERRwriteprot 19/* media is write protected */ #define ERRgeneral 31#define ERRbadshare 32/* The sharing mode specified for an Open conflicts with existing FIDs on
Signature · 1 line
1.7.1.1
A message that is not in the archive (sent off-list or not yet received): 1280154598-29628-1-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org
PATCH 2/2 cifs: ignore the "mand", "nomand" and "_netdev" mount options
These are all handled by the userspace mount programs, but older versions of mount.cifs also handed them off to the kernel. Ignore them.
--- fs/cifs/connect.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-)
fs/cifs/connect.c +6 -0
@@ -1264,6 +1264,12 @@ cifs_parse_mount_options(char *options, const char *devname, }else if ((strnicmp (data,"nocase" ,6 ) ==0 ) || (strnicmp (data,"ignorecase" ,10 ) ==0 )) { vol->nocase =1 ; + }else if (strnicmp (data,"mand" ,4 ) ==0 ) { +/* ignore */ + }else if (strnicmp (data,"nomand" ,6 ) ==0 ) { +/* ignore */ + }else if (strnicmp (data,"_netdev" ,7 ) ==0 ) { +/* ignore */ }else if (strnicmp (data,"brl" ,3 ) ==0 ) { vol->nobrl =0 ; } else if ((strnicmp(data, "nobrl", 5) == 0) ||
Signature · 1 line
1.7.1.1
Quoted 1 line · Jeff Layton
Seems like a more sensible mapping than
-EIO.
I agree. Also helps common case of Samba exporting read only shares by default.
Quoted 34 lines
Signed-off-by Jeff Layton <[email protected]>---
fs/cifs/netmisc.c | 1 +
fs/cifs/smberr.h | 1 +2 files changed, 2 insertions(+), 0 deletions(-)fs/cifs/netmisc.c +1
-0@@ -61,6 +61,7 @@ static const struct smb_to_posix_error mapping_table_ERRDOS[] = { {ERRremcd, -EACCES}, {ERRdiffdevice, -EXDEV}, {ERRnofiles, -ENOENT}, + {ERRwriteprot, -EROFS}, {ERRbadshare, -ETXTBSY}, {ERRlock, -EACCES}, {ERRunsup, -EINVAL},fs/cifs/smberr.h +0
-0@@ -76,6 +76,7 @@ #define ERRnofiles 18 /* A File Search command can find nomore files matching the specified criteria. */
+#define ERRwriteprot 19 /* media is write protected */ #define ERRgeneral 31
#define ERRbadshare 32 /* The sharing mode specified for an Open conflicts with existing FIDs on --
1.7.1.1
Signature · 3 lines
Thanks, Steve