Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+19 -12
+19 -12
fs/ntfs3/super.c
··· 284 284 fsparam_flag("hide_dot_files", Opt_hide_dot_files), 285 285 fsparam_flag("windows_names", Opt_windows_names), 286 286 fsparam_flag("showmeta", Opt_showmeta), 287 - fsparam_flag("acl", Opt_acl), 287 + fsparam_flag_no("acl", Opt_acl), 288 288 fsparam_string("iocharset", Opt_iocharset), 289 - fsparam_flag("prealloc", Opt_prealloc), 289 + fsparam_flag_no("prealloc", Opt_prealloc), 290 290 fsparam_flag("nocase", Opt_nocase), 291 291 {} 292 292 }; ··· 395 395 param->string = NULL; 396 396 break; 397 397 case Opt_prealloc: 398 - opts->prealloc = 1; 398 + opts->prealloc = !result.negated; 399 399 break; 400 400 case Opt_nocase: 401 401 opts->nocase = 1; ··· 1259 1259 sb->s_export_op = &ntfs_export_ops; 1260 1260 sb->s_time_gran = NTFS_TIME_GRAN; // 100 nsec 1261 1261 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); 1263 1263 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); 1268 1268 err = -EINVAL; 1269 1269 goto out; 1270 1270 } ··· 1676 1676 put_inode_out: 1677 1677 iput(inode); 1678 1678 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); 1683 1684 sbi->options = NULL; 1684 1685 } 1685 1686 ··· 1809 1808 opts->fs_gid = current_gid(); 1810 1809 opts->fs_fmask_inv = ~current_umask(); 1811 1810 opts->fs_dmask_inv = ~current_umask(); 1811 + opts->prealloc = 1; 1812 + 1813 + #ifdef CONFIG_NTFS3_FS_POSIX_ACL 1814 + /* Set the default value 'acl' */ 1815 + fc->sb_flags |= SB_POSIXACL; 1816 + #endif 1812 1817 1813 1818 if (fc->purpose == FS_CONTEXT_FOR_RECONFIGURE) 1814 1819 goto ok;