Skip to content

Commit

Permalink
cifs: mapchars mount option ignored
Browse files Browse the repository at this point in the history
commit cb8b02f upstream.

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 <tspivey8@gmail.com>
Fixes: 24e0a1e ("cifs: switch to new mount api")
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Steve French authored and gregkh committed May 30, 2023
1 parent 91dd8aa commit 9437341
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions fs/cifs/fs_context.c
Expand Up @@ -904,6 +904,14 @@ static int smb3_fs_context_parse_param(struct fs_context *fc,
ctx->sfu_remap = false; /* disable SFU mapping */
}
break;
case Opt_mapchars:
if (result.negated)
ctx->sfu_remap = false;
else {
ctx->sfu_remap = true;
ctx->remap = false; /* disable SFM (mapposix) mapping */
}
break;
case Opt_user_xattr:
if (result.negated)
ctx->no_xattr = 1;
Expand Down

0 comments on commit 9437341

Please sign in to comment.