Skip to content

Commit 3c62489

Browse files
fs/ntfs3: allow explicit boolean acl/prealloc mount options
This patch improves mount option parsing by allowing explicit boolean values for acl and prealloc. Previously those options were exposed only as presence/absence flags. Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
1 parent b2bc7c4 commit 3c62489

1 file changed

Lines changed: 14 additions & 6 deletions

File tree

fs/ntfs3/super.c

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -264,8 +264,10 @@ enum Opt {
264264
Opt_windows_names,
265265
Opt_showmeta,
266266
Opt_acl,
267+
Opt_acl_bool,
267268
Opt_iocharset,
268269
Opt_prealloc,
270+
Opt_prealloc_bool,
269271
Opt_nocase,
270272
Opt_err,
271273
};
@@ -285,9 +287,11 @@ static const struct fs_parameter_spec ntfs_fs_parameters[] = {
285287
fsparam_flag("hide_dot_files", Opt_hide_dot_files),
286288
fsparam_flag("windows_names", Opt_windows_names),
287289
fsparam_flag("showmeta", Opt_showmeta),
288-
fsparam_flag_no("acl", Opt_acl),
290+
fsparam_flag("acl", Opt_acl),
291+
fsparam_bool("acl", Opt_acl_bool),
289292
fsparam_string("iocharset", Opt_iocharset),
290-
fsparam_flag_no("prealloc", Opt_prealloc),
293+
fsparam_flag("prealloc", Opt_prealloc),
294+
fsparam_bool("prealloc", Opt_prealloc_bool),
291295
fsparam_flag("nocase", Opt_nocase),
292296
{}
293297
};
@@ -379,15 +383,16 @@ static int ntfs_fs_parse_param(struct fs_context *fc,
379383
case Opt_showmeta:
380384
opts->showmeta = 1;
381385
break;
382-
case Opt_acl:
383-
if (!result.negated)
386+
case Opt_acl_bool:
387+
if (result.boolean) {
388+
case Opt_acl:
384389
#ifdef CONFIG_NTFS3_FS_POSIX_ACL
385390
fc->sb_flags |= SB_POSIXACL;
386391
#else
387392
return invalf(
388393
fc, "ntfs3: Support for ACL not compiled in!");
389394
#endif
390-
else
395+
} else
391396
fc->sb_flags &= ~SB_POSIXACL;
392397
break;
393398
case Opt_iocharset:
@@ -396,7 +401,10 @@ static int ntfs_fs_parse_param(struct fs_context *fc,
396401
param->string = NULL;
397402
break;
398403
case Opt_prealloc:
399-
opts->prealloc = !result.negated;
404+
opts->prealloc = 1;
405+
break;
406+
case Opt_prealloc_bool:
407+
opts->prealloc = result.boolean;
400408
break;
401409
case Opt_nocase:
402410
opts->nocase = 1;

0 commit comments

Comments
 (0)