Merge tag 'gfs2-v6.6-rc1-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git...
authorLinus Torvalds <torvalds@linux-foundation.org>
Mon, 18 Sep 2023 18:59:38 +0000 (11:59 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 18 Sep 2023 18:59:38 +0000 (11:59 -0700)
Pull gfs2 fixes from Andreas Gruenbacher:

 - Fix another freeze/thaw hang

 - Fix glock cache shrinking

 - Fix the quota=quiet mount option

* tag 'gfs2-v6.6-rc1-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2:
  gfs2: Fix quota=quiet oversight
  gfs2: fix glock shrinker ref issues
  gfs2: Fix another freeze/thaw hang

fs/gfs2/glock.c
fs/gfs2/glops.c
fs/gfs2/quota.h

index 9cbf8d98489a4a67b05c8e2cfae16d34aeb594d9..4a280be229a6517b3a9bdd219051b0967af0249f 100644 (file)
@@ -2010,7 +2010,9 @@ static long gfs2_scan_glock_lru(int nr)
                if (!test_bit(GLF_LOCK, &gl->gl_flags)) {
                        if (!spin_trylock(&gl->gl_lockref.lock))
                                continue;
-                       if (!gl->gl_lockref.count) {
+                       if (gl->gl_lockref.count <= 1 &&
+                           (gl->gl_state == LM_ST_UNLOCKED ||
+                            demote_ok(gl))) {
                                list_move(&gl->gl_lru, &dispose);
                                atomic_dec(&lru_count);
                                freed++;
index d26759a98b1074d417be5ecf2c1c52e934af73fd..f41ca89d216bc243a405b70482301649098fcba0 100644 (file)
@@ -567,15 +567,16 @@ static void freeze_go_callback(struct gfs2_glock *gl, bool remote)
        struct super_block *sb = sdp->sd_vfs;
 
        if (!remote ||
-           gl->gl_state != LM_ST_SHARED ||
+           (gl->gl_state != LM_ST_SHARED &&
+            gl->gl_state != LM_ST_UNLOCKED) ||
            gl->gl_demote_state != LM_ST_UNLOCKED)
                return;
 
        /*
         * Try to get an active super block reference to prevent racing with
-        * unmount (see trylock_super()).  But note that unmount isn't the only
-        * place where a write lock on s_umount is taken, and we can fail here
-        * because of things like remount as well.
+        * unmount (see super_trylock_shared()).  But note that unmount isn't
+        * the only place where a write lock on s_umount is taken, and we can
+        * fail here because of things like remount as well.
         */
        if (down_read_trylock(&sb->s_umount)) {
                atomic_inc(&sb->s_active);
index 21ada332d55571021bda02fb55be74da43952388..1429945215a039dad28c05de4bc419ad0ebd6b79 100644 (file)
@@ -50,7 +50,8 @@ static inline int gfs2_quota_lock_check(struct gfs2_inode *ip,
        ret = gfs2_quota_lock(ip, NO_UID_QUOTA_CHANGE, NO_GID_QUOTA_CHANGE);
        if (ret)
                return ret;
-       if (sdp->sd_args.ar_quota != GFS2_QUOTA_ON)
+       if (sdp->sd_args.ar_quota != GFS2_QUOTA_ON &&
+           sdp->sd_args.ar_quota != GFS2_QUOTA_QUIET)
                return 0;
        ret = gfs2_quota_check(ip, ip->i_inode.i_uid, ip->i_inode.i_gid, ap);
        if (ret)