Skip to content

Commit cb8b02f

Browse files
author
Steve French
committed
cifs: mapchars mount option ignored
There are two ways that special characters (not allowed in some other operating systems like Windows, but allowed in POSIX) have been mapped in the past ("SFU" and "SFM" mappings) to allow them to be stored in a range reserved for special chars. The default for Linux has been to use "mapposix" (ie the SFM mapping) but the conversion to the new mount API in the 5.11 kernel broke the ability to override the default mapping of the reserved characters (like '?' and '*' and '\') via "mapchars" mount option. This patch fixes that - so can now mount with "mapchars" mount option to override the default ("mapposix" ie SFM) mapping. Reported-by: Tyler Spivey <[email protected]> Fixes: 24e0a1e ("cifs: switch to new mount api") Signed-off-by: Steve French <[email protected]>
1 parent 8b4dd44 commit cb8b02f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

fs/cifs/fs_context.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -904,6 +904,14 @@ static int smb3_fs_context_parse_param(struct fs_context *fc,
904904
ctx->sfu_remap = false; /* disable SFU mapping */
905905
}
906906
break;
907+
case Opt_mapchars:
908+
if (result.negated)
909+
ctx->sfu_remap = false;
910+
else {
911+
ctx->sfu_remap = true;
912+
ctx->remap = false; /* disable SFM (mapposix) mapping */
913+
}
914+
break;
907915
case Opt_user_xattr:
908916
if (result.negated)
909917
ctx->no_xattr = 1;

0 commit comments

Comments
 (0)