]> Git Repo - J-linux.git/commitdiff
Merge tag 'gfs2-v6.2-rc5-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git...
authorLinus Torvalds <[email protected]>
Wed, 22 Feb 2023 22:00:53 +0000 (14:00 -0800)
committerLinus Torvalds <[email protected]>
Wed, 22 Feb 2023 22:00:53 +0000 (14:00 -0800)
Pull gfs2 updates from Andreas Gruenbacher:

 - Fix a race when disassociating inodes from their glocks after
   iget_failed()

 - On filesystems with a block size smaller than the page size, make
   sure that ->writepages() writes out all buffers of journaled inodes

 - Various improvements to the way the delete workqueue is drained to
   speed up unmount and prevent leftover inodes. At unmount time, evict
   deleted inodes cooperatively across the cluster to avoid unnecessary
   timeouts

 - Various minor cleanups and fixes

* tag 'gfs2-v6.2-rc5-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2:
  gfs2: Convert gfs2_page_add_databufs to folios
  gfs2: jdata writepage fix
  gfs2: Improve gfs2_make_fs_rw error handling
  Revert "GFS2: free disk inode which is deleted by remote node -V2"
  gfs2: Evict inodes cooperatively
  gfs2: Flush delete work before shrinking inode cache
  gfs2: Cease delete work during unmount
  gfs2: Add SDF_DEACTIVATING super block flag
  gfs2: check gl_object in rgrp glops
  gfs2: Split the two kinds of glock "delete" work
  gfs2: Move delete workqueue into super block
  gfs2: Get rid of GLF_PENDING_DELETE flag
  gfs2: Make glock lru list scanning safer
  gfs2: Clean up gfs2_scan_glock_lru
  gfs2: Improve gfs2_upgrade_iopen_glock comment
  gfs2: gl_object races fix

1  2 
fs/gfs2/inode.c

diff --combined fs/gfs2/inode.c
index 713efa3bb7322b6713eff40b0e8405ca2d5e575c,c76fdb8f951ff0557bd66317ec0fcaa75f6b2c3e..1291b5ee35842f69d13a3a19428e99339034d6c9
@@@ -225,6 -225,10 +225,10 @@@ fail
                gfs2_glock_dq_uninit(&ip->i_iopen_gh);
        if (gfs2_holder_initialized(&i_gh))
                gfs2_glock_dq_uninit(&i_gh);
+       if (ip->i_gl) {
+               gfs2_glock_put(ip->i_gl);
+               ip->i_gl = NULL;
+       }
        iget_failed(inode);
        return ERR_PTR(error);
  }
@@@ -320,7 -324,7 +324,7 @@@ struct inode *gfs2_lookupi(struct inod
        }
  
        if (!is_root) {
 -              error = gfs2_permission(&init_user_ns, dir, MAY_EXEC);
 +              error = gfs2_permission(&nop_mnt_idmap, dir, MAY_EXEC);
                if (error)
                        goto out;
        }
@@@ -350,7 -354,7 +354,7 @@@ static int create_ok(struct gfs2_inode 
  {
        int error;
  
 -      error = gfs2_permission(&init_user_ns, &dip->i_inode,
 +      error = gfs2_permission(&nop_mnt_idmap, &dip->i_inode,
                                MAY_WRITE | MAY_EXEC);
        if (error)
                return error;
@@@ -816,6 -820,10 +820,10 @@@ fail_gunlock3
  fail_gunlock2:
        gfs2_glock_put(io_gl);
  fail_free_inode:
+       if (ip->i_gl) {
+               gfs2_glock_put(ip->i_gl);
+               ip->i_gl = NULL;
+       }
        gfs2_rs_deltree(&ip->i_res);
        gfs2_qa_put(ip);
  fail_free_acls:
@@@ -843,7 -851,7 +851,7 @@@ fail
  
  /**
   * gfs2_create - Create a file
 - * @mnt_userns: User namespace of the mount the inode was found from
 + * @idmap: idmap of the mount the inode was found from
   * @dir: The directory in which to create the file
   * @dentry: The dentry of the new file
   * @mode: The mode of the new file
   * Returns: errno
   */
  
 -static int gfs2_create(struct user_namespace *mnt_userns, struct inode *dir,
 +static int gfs2_create(struct mnt_idmap *idmap, struct inode *dir,
                       struct dentry *dentry, umode_t mode, bool excl)
  {
        return gfs2_create_inode(dir, dentry, NULL, S_IFREG | mode, 0, NULL, 0, excl);
@@@ -960,7 -968,7 +968,7 @@@ static int gfs2_link(struct dentry *old
        if (inode->i_nlink == 0)
                goto out_gunlock;
  
 -      error = gfs2_permission(&init_user_ns, dir, MAY_WRITE | MAY_EXEC);
 +      error = gfs2_permission(&nop_mnt_idmap, dir, MAY_WRITE | MAY_EXEC);
        if (error)
                goto out_gunlock;
  
@@@ -1078,7 -1086,7 +1086,7 @@@ static int gfs2_unlink_ok(struct gfs2_i
        if (IS_APPEND(&dip->i_inode))
                return -EPERM;
  
 -      error = gfs2_permission(&init_user_ns, &dip->i_inode,
 +      error = gfs2_permission(&nop_mnt_idmap, &dip->i_inode,
                                MAY_WRITE | MAY_EXEC);
        if (error)
                return error;
@@@ -1207,7 -1215,7 +1215,7 @@@ out_inodes
  
  /**
   * gfs2_symlink - Create a symlink
 - * @mnt_userns: User namespace of the mount the inode was found from
 + * @idmap: idmap of the mount the inode was found from
   * @dir: The directory to create the symlink in
   * @dentry: The dentry to put the symlink in
   * @symname: The thing which the link points to
   * Returns: errno
   */
  
 -static int gfs2_symlink(struct user_namespace *mnt_userns, struct inode *dir,
 +static int gfs2_symlink(struct mnt_idmap *idmap, struct inode *dir,
                        struct dentry *dentry, const char *symname)
  {
        unsigned int size;
  
  /**
   * gfs2_mkdir - Make a directory
 - * @mnt_userns: User namespace of the mount the inode was found from
 + * @idmap: idmap of the mount the inode was found from
   * @dir: The parent directory of the new one
   * @dentry: The dentry of the new directory
   * @mode: The mode of the new directory
   * Returns: errno
   */
  
 -static int gfs2_mkdir(struct user_namespace *mnt_userns, struct inode *dir,
 +static int gfs2_mkdir(struct mnt_idmap *idmap, struct inode *dir,
                      struct dentry *dentry, umode_t mode)
  {
        unsigned dsize = gfs2_max_stuffed_size(GFS2_I(dir));
  
  /**
   * gfs2_mknod - Make a special file
 - * @mnt_userns: User namespace of the mount the inode was found from
 + * @idmap: idmap of the mount the inode was found from
   * @dir: The directory in which the special file will reside
   * @dentry: The dentry of the special file
   * @mode: The mode of the special file
   *
   */
  
 -static int gfs2_mknod(struct user_namespace *mnt_userns, struct inode *dir,
 +static int gfs2_mknod(struct mnt_idmap *idmap, struct inode *dir,
                      struct dentry *dentry, umode_t mode, dev_t dev)
  {
        return gfs2_create_inode(dir, dentry, NULL, mode, dev, NULL, 0, 0);
@@@ -1504,7 -1512,7 +1512,7 @@@ static int gfs2_rename(struct inode *od
                        }
                }
        } else {
 -              error = gfs2_permission(&init_user_ns, ndir,
 +              error = gfs2_permission(&nop_mnt_idmap, ndir,
                                        MAY_WRITE | MAY_EXEC);
                if (error)
                        goto out_gunlock;
        /* Check out the dir to be renamed */
  
        if (dir_rename) {
 -              error = gfs2_permission(&init_user_ns, d_inode(odentry),
 +              error = gfs2_permission(&nop_mnt_idmap, d_inode(odentry),
                                        MAY_WRITE);
                if (error)
                        goto out_gunlock;
@@@ -1705,13 -1713,13 +1713,13 @@@ static int gfs2_exchange(struct inode *
                goto out_gunlock;
  
        if (S_ISDIR(old_mode)) {
 -              error = gfs2_permission(&init_user_ns, odentry->d_inode,
 +              error = gfs2_permission(&nop_mnt_idmap, odentry->d_inode,
                                        MAY_WRITE);
                if (error)
                        goto out_gunlock;
        }
        if (S_ISDIR(new_mode)) {
 -              error = gfs2_permission(&init_user_ns, ndentry->d_inode,
 +              error = gfs2_permission(&nop_mnt_idmap, ndentry->d_inode,
                                        MAY_WRITE);
                if (error)
                        goto out_gunlock;
@@@ -1766,7 -1774,7 +1774,7 @@@ out
        return error;
  }
  
 -static int gfs2_rename2(struct user_namespace *mnt_userns, struct inode *odir,
 +static int gfs2_rename2(struct mnt_idmap *idmap, struct inode *odir,
                        struct dentry *odentry, struct inode *ndir,
                        struct dentry *ndentry, unsigned int flags)
  {
@@@ -1841,7 -1849,7 +1849,7 @@@ out
  
  /**
   * gfs2_permission
 - * @mnt_userns: User namespace of the mount the inode was found from
 + * @idmap: idmap of the mount the inode was found from
   * @inode: The inode
   * @mask: The mask to be tested
   *
   * Returns: errno
   */
  
 -int gfs2_permission(struct user_namespace *mnt_userns, struct inode *inode,
 +int gfs2_permission(struct mnt_idmap *idmap, struct inode *inode,
                    int mask)
  {
        struct gfs2_inode *ip;
        if ((mask & MAY_WRITE) && IS_IMMUTABLE(inode))
                error = -EPERM;
        else
 -              error = generic_permission(&init_user_ns, inode, mask);
 +              error = generic_permission(&nop_mnt_idmap, inode, mask);
        if (gfs2_holder_initialized(&i_gh))
                gfs2_glock_dq_uninit(&i_gh);
  
  
  static int __gfs2_setattr_simple(struct inode *inode, struct iattr *attr)
  {
 -      setattr_copy(&init_user_ns, inode, attr);
 +      setattr_copy(&nop_mnt_idmap, inode, attr);
        mark_inode_dirty(inode);
        return 0;
  }
@@@ -1966,7 -1974,7 +1974,7 @@@ out
  
  /**
   * gfs2_setattr - Change attributes on an inode
 - * @mnt_userns: User namespace of the mount the inode was found from
 + * @idmap: idmap of the mount the inode was found from
   * @dentry: The dentry which is changing
   * @attr: The structure describing the change
   *
   * Returns: errno
   */
  
 -static int gfs2_setattr(struct user_namespace *mnt_userns,
 +static int gfs2_setattr(struct mnt_idmap *idmap,
                        struct dentry *dentry, struct iattr *attr)
  {
        struct inode *inode = d_inode(dentry);
        if (error)
                goto out;
  
 -      error = may_setattr(&init_user_ns, inode, attr->ia_valid);
 +      error = may_setattr(&nop_mnt_idmap, inode, attr->ia_valid);
        if (error)
                goto error;
  
 -      error = setattr_prepare(&init_user_ns, dentry, attr);
 +      error = setattr_prepare(&nop_mnt_idmap, dentry, attr);
        if (error)
                goto error;
  
        else {
                error = gfs2_setattr_simple(inode, attr);
                if (!error && attr->ia_valid & ATTR_MODE)
 -                      error = posix_acl_chmod(&init_user_ns, dentry,
 +                      error = posix_acl_chmod(&nop_mnt_idmap, dentry,
                                                inode->i_mode);
        }
  
@@@ -2022,7 -2030,7 +2030,7 @@@ out
  
  /**
   * gfs2_getattr - Read out an inode's attributes
 - * @mnt_userns:       user namespace of the mount the inode was found from
 + * @idmap: idmap of the mount the inode was found from
   * @path: Object to query
   * @stat: The inode's stats
   * @request_mask: Mask of STATX_xxx flags indicating the caller's interests
   * Returns: errno
   */
  
 -static int gfs2_getattr(struct user_namespace *mnt_userns,
 +static int gfs2_getattr(struct mnt_idmap *idmap,
                        const struct path *path, struct kstat *stat,
                        u32 request_mask, unsigned int flags)
  {
                                  STATX_ATTR_IMMUTABLE |
                                  STATX_ATTR_NODUMP);
  
 -      generic_fillattr(&init_user_ns, inode, stat);
 +      generic_fillattr(&nop_mnt_idmap, inode, stat);
  
        if (gfs2_holder_initialized(&gh))
                gfs2_glock_dq_uninit(&gh);
This page took 0.070838 seconds and 4 git commands to generate.