gfs2: Two quota=account mode fixes
authorAndreas Gruenbacher <agruenba@redhat.com>
Sat, 21 Oct 2023 22:06:41 +0000 (00:06 +0200)
committerAndreas Gruenbacher <agruenba@redhat.com>
Thu, 2 Nov 2023 19:09:38 +0000 (20:09 +0100)
Make sure we don't skip accounting for quota changes with the
quota=account mount option.

Reviewed-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
fs/gfs2/quota.c
fs/gfs2/quota.h

index 41d0232532a0317379a21fd64f7af13cea1ccc7d..d0d01d4856215f11563ac6fd55c34201ef794413 100644 (file)
@@ -1083,8 +1083,7 @@ int gfs2_quota_lock(struct gfs2_inode *ip, kuid_t uid, kgid_t gid)
        u32 x;
        int error;
 
-       if (sdp->sd_args.ar_quota != GFS2_QUOTA_ON &&
-           sdp->sd_args.ar_quota != GFS2_QUOTA_QUIET)
+       if (sdp->sd_args.ar_quota == GFS2_QUOTA_OFF)
                return 0;
 
        error = gfs2_quota_hold(ip, uid, gid);
@@ -1285,8 +1284,7 @@ void gfs2_quota_change(struct gfs2_inode *ip, s64 change,
        u32 x;
        struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode);
 
-       if ((sdp->sd_args.ar_quota != GFS2_QUOTA_ON &&
-           sdp->sd_args.ar_quota != GFS2_QUOTA_QUIET) ||
+       if (sdp->sd_args.ar_quota == GFS2_QUOTA_OFF ||
            gfs2_assert_warn(sdp, change))
                return;
        if (ip->i_diskflags & GFS2_DIF_SYSTEM)
index 1429945215a039dad28c05de4bc419ad0ebd6b79..e0ff5ae1e658a2db7f15948f4d79c79333db5e91 100644 (file)
@@ -50,8 +50,7 @@ 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 &&
-           sdp->sd_args.ar_quota != GFS2_QUOTA_QUIET)
+       if (sdp->sd_args.ar_quota == GFS2_QUOTA_ACCOUNT)
                return 0;
        ret = gfs2_quota_check(ip, ip->i_inode.i_uid, ip->i_inode.i_gid, ap);
        if (ret)