fs/ntfs3: Remove noacsrules
authorKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
Mon, 16 Jan 2023 08:52:10 +0000 (12:52 +0400)
committerKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
Mon, 27 Mar 2023 12:59:17 +0000 (16:59 +0400)
Currently, this option does not work properly. Its use leads to unstable results.
If we figure out how to implement it without errors, we will add it later.

Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Documentation/filesystems/ntfs3.rst
fs/ntfs3/file.c
fs/ntfs3/inode.c
fs/ntfs3/namei.c
fs/ntfs3/ntfs_fs.h
fs/ntfs3/super.c
fs/ntfs3/xattr.c

index 5aa102bd72c2fcdc3ba3f94ac12bac6a22c178cd..f0cf05cad2ba97827568c621051ff15783a82ac8 100644 (file)
@@ -61,17 +61,6 @@ this table marked with no it means default is without **no**.
        directories, fmask applies only to files and dmask only to directories.
    * - fmask=
 
-   * - noacsrules
-     - "No access rules" mount option sets access rights for files/folders to
-       777 and owner/group to root. This mount option absorbs all other
-       permissions.
-
-       - Permissions change for files/folders will be reported as successful,
-        but they will remain 777.
-
-       - Owner/group change will be reported as successful, butthey will stay
-        as root.
-
    * - nohidden
      - Files with the Windows-specific HIDDEN (FILE_ATTRIBUTE_HIDDEN) attribute
        will not be shown under Linux.
index b3b72673fa5e24851c291c78aa86ab4cbbae805c..e4b54d6bcda54983ceccc555e28218543a881e3c 100644 (file)
@@ -654,22 +654,12 @@ out:
 int ntfs3_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
                  struct iattr *attr)
 {
-       struct super_block *sb = dentry->d_sb;
-       struct ntfs_sb_info *sbi = sb->s_fs_info;
        struct inode *inode = d_inode(dentry);
        struct ntfs_inode *ni = ntfs_i(inode);
        u32 ia_valid = attr->ia_valid;
        umode_t mode = inode->i_mode;
        int err;
 
-       if (sbi->options->noacsrules) {
-               /* "No access rules" - Force any changes of time etc. */
-               attr->ia_valid |= ATTR_FORCE;
-               /* and disable for editing some attributes. */
-               attr->ia_valid &= ~(ATTR_UID | ATTR_GID | ATTR_MODE);
-               ia_valid = attr->ia_valid;
-       }
-
        err = setattr_prepare(idmap, dentry, attr);
        if (err)
                goto out;
@@ -1153,7 +1143,6 @@ const struct inode_operations ntfs_file_inode_operations = {
        .getattr        = ntfs_getattr,
        .setattr        = ntfs3_setattr,
        .listxattr      = ntfs_listxattr,
-       .permission     = ntfs_permission,
        .get_inode_acl  = ntfs_get_acl,
        .set_acl        = ntfs_set_acl,
        .fiemap         = ntfs_fiemap,
index bb004e47656388866f41d696c567c2f39a2bed44..31f7e97fa43eb7964e09eafb61bc1210347cb66b 100644 (file)
@@ -2070,7 +2070,6 @@ const struct inode_operations ntfs_link_inode_operations = {
        .get_link       = ntfs_get_link,
        .setattr        = ntfs3_setattr,
        .listxattr      = ntfs_listxattr,
-       .permission     = ntfs_permission,
 };
 
 const struct address_space_operations ntfs_aops = {
index 92bbc8ee83cac9aa5a50ed802181d15034eda103..fdd11f2a1883cf01bdf8d56eb55a1a1dece42e8f 100644 (file)
@@ -607,7 +607,6 @@ const struct inode_operations ntfs_dir_inode_operations = {
        .rmdir          = ntfs_rmdir,
        .mknod          = ntfs_mknod,
        .rename         = ntfs_rename,
-       .permission     = ntfs_permission,
        .get_inode_acl  = ntfs_get_acl,
        .set_acl        = ntfs_set_acl,
        .setattr        = ntfs3_setattr,
index 15296f5690b5a0df5a2a65b20296d5d440f44f42..85efb34d211c50d662a79608806c1fffb1416dff 100644 (file)
@@ -100,7 +100,6 @@ struct ntfs_mount_options {
        unsigned hide_dot_files : 1; /* Set hidden flag on dot files. */
        unsigned windows_names : 1; /* Disallow names forbidden by Windows. */
        unsigned force : 1; /* RW mount dirty volume. */
-       unsigned noacsrules : 1; /* Exclude acs rules. */
        unsigned prealloc : 1; /* Preallocate space when file is growing. */
        unsigned nocase : 1; /* case insensitive. */
 };
@@ -870,8 +869,6 @@ int ntfs_init_acl(struct mnt_idmap *idmap, struct inode *inode,
 #endif
 
 int ntfs_acl_chmod(struct mnt_idmap *idmap, struct dentry *dentry);
-int ntfs_permission(struct mnt_idmap *idmap, struct inode *inode,
-                   int mask);
 ssize_t ntfs_listxattr(struct dentry *dentry, char *buffer, size_t size);
 extern const struct xattr_handler *ntfs_xattr_handlers[];
 
index 19d0889b131fac69341981b7a73e5955b8ebc176..10c019ef7da31af73ac9b54d62bfd098f0445026 100644 (file)
@@ -253,7 +253,6 @@ enum Opt {
        Opt_acl,
        Opt_iocharset,
        Opt_prealloc,
-       Opt_noacsrules,
        Opt_nocase,
        Opt_err,
 };
@@ -274,7 +273,6 @@ static const struct fs_parameter_spec ntfs_fs_parameters[] = {
        fsparam_flag_no("acl",                  Opt_acl),
        fsparam_flag_no("showmeta",             Opt_showmeta),
        fsparam_flag_no("prealloc",             Opt_prealloc),
-       fsparam_flag_no("acsrules",             Opt_noacsrules),
        fsparam_flag_no("nocase",               Opt_nocase),
        fsparam_string("iocharset",             Opt_iocharset),
        {}
@@ -387,9 +385,6 @@ static int ntfs_fs_parse_param(struct fs_context *fc,
        case Opt_prealloc:
                opts->prealloc = result.negated ? 0 : 1;
                break;
-       case Opt_noacsrules:
-               opts->noacsrules = result.negated ? 1 : 0;
-               break;
        case Opt_nocase:
                opts->nocase = result.negated ? 1 : 0;
                break;
@@ -572,8 +567,6 @@ static int ntfs_show_options(struct seq_file *m, struct dentry *root)
                seq_puts(m, ",hide_dot_files");
        if (opts->force)
                seq_puts(m, ",force");
-       if (opts->noacsrules)
-               seq_puts(m, ",noacsrules");
        if (opts->prealloc)
                seq_puts(m, ",prealloc");
        if (sb->s_flags & SB_POSIXACL)
@@ -791,7 +784,7 @@ static int ntfs_init_from_boot(struct super_block *sb, u32 sector_size,
        if (boot_sector_size != sector_size) {
                ntfs_warn(
                        sb,
-                       "Different NTFS' sector size (%u) and media sector size (%u)",
+                       "Different NTFS sector size (%u) and media sector size (%u)",
                        boot_sector_size, sector_size);
                dev_size += sector_size - 1;
        }
index 4746959af96424585102f8b68e1540a7627f03d5..4cab20d70c79c76a5036a371098adf62609dc7a6 100644 (file)
@@ -711,20 +711,6 @@ int ntfs_acl_chmod(struct mnt_idmap *idmap, struct dentry *dentry)
        return posix_acl_chmod(idmap, dentry, inode->i_mode);
 }
 
-/*
- * ntfs_permission - inode_operations::permission
- */
-int ntfs_permission(struct mnt_idmap *idmap, struct inode *inode,
-                   int mask)
-{
-       if (ntfs_sb(inode->i_sb)->options->noacsrules) {
-               /* "No access rules" mode - Allow all changes. */
-               return 0;
-       }
-
-       return generic_permission(idmap, inode, mask);
-}
-
 /*
  * ntfs_listxattr - inode_operations::listxattr
  */