Skip to content

Commit bcbb8d0

Browse files
fs/ntfs3: change the default mount options for "acl" and "prealloc"
Switch the "acl" and "prealloc" mount parameters to fsparam_flag_no(), making them enabled by default and allowing users to disable them with "noacl" and "noprealloc". Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
1 parent ccc4e86 commit bcbb8d0

1 file changed

Lines changed: 19 additions & 12 deletions

File tree

fs/ntfs3/super.c

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -284,9 +284,9 @@ static const struct fs_parameter_spec ntfs_fs_parameters[] = {
284284
fsparam_flag("hide_dot_files", Opt_hide_dot_files),
285285
fsparam_flag("windows_names", Opt_windows_names),
286286
fsparam_flag("showmeta", Opt_showmeta),
287-
fsparam_flag("acl", Opt_acl),
287+
fsparam_flag_no("acl", Opt_acl),
288288
fsparam_string("iocharset", Opt_iocharset),
289-
fsparam_flag("prealloc", Opt_prealloc),
289+
fsparam_flag_no("prealloc", Opt_prealloc),
290290
fsparam_flag("nocase", Opt_nocase),
291291
{}
292292
};
@@ -395,7 +395,7 @@ static int ntfs_fs_parse_param(struct fs_context *fc,
395395
param->string = NULL;
396396
break;
397397
case Opt_prealloc:
398-
opts->prealloc = 1;
398+
opts->prealloc = !result.negated;
399399
break;
400400
case Opt_nocase:
401401
opts->nocase = 1;
@@ -1259,12 +1259,12 @@ static int ntfs_fill_super(struct super_block *sb, struct fs_context *fc)
12591259
sb->s_export_op = &ntfs_export_ops;
12601260
sb->s_time_gran = NTFS_TIME_GRAN; // 100 nsec
12611261
sb->s_xattr = ntfs_xattr_handlers;
1262-
set_default_d_op(sb, sbi->options->nocase ? &ntfs_dentry_ops : NULL);
1262+
set_default_d_op(sb, options->nocase ? &ntfs_dentry_ops : NULL);
12631263

1264-
sbi->options->nls = ntfs_load_nls(sbi->options->nls_name);
1265-
if (IS_ERR(sbi->options->nls)) {
1266-
sbi->options->nls = NULL;
1267-
errorf(fc, "Cannot load nls %s", fc_opts->nls_name);
1264+
options->nls = ntfs_load_nls(options->nls_name);
1265+
if (IS_ERR(options->nls)) {
1266+
options->nls = NULL;
1267+
errorf(fc, "Cannot load nls %s", options->nls_name);
12681268
err = -EINVAL;
12691269
goto out;
12701270
}
@@ -1676,10 +1676,11 @@ static int ntfs_fill_super(struct super_block *sb, struct fs_context *fc)
16761676
put_inode_out:
16771677
iput(inode);
16781678
out:
1679-
if (sbi && sbi->options) {
1680-
unload_nls(sbi->options->nls);
1681-
kfree(sbi->options->nls_name);
1682-
kfree(sbi->options);
1679+
/* sbi->options == options */
1680+
if (options) {
1681+
unload_nls(options->nls);
1682+
kfree(options->nls_name);
1683+
kfree(options);
16831684
sbi->options = NULL;
16841685
}
16851686

@@ -1808,6 +1809,12 @@ static int __ntfs_init_fs_context(struct fs_context *fc)
18081809
opts->fs_gid = current_gid();
18091810
opts->fs_fmask_inv = ~current_umask();
18101811
opts->fs_dmask_inv = ~current_umask();
1812+
opts->prealloc = 1;
1813+
1814+
#ifdef CONFIG_NTFS3_FS_POSIX_ACL
1815+
/* Set the default value 'acl' */
1816+
fc->sb_flags |= SB_POSIXACL;
1817+
#endif
18111818

18121819
if (fc->purpose == FS_CONTEXT_FOR_RECONFIGURE)
18131820
goto ok;

0 commit comments

Comments
 (0)