Skip to content

Commit 703df11

Browse files
author
Andreas Gruenbacher
committed
gfs2: Two quota=account mode fixes
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>
1 parent 1358706 commit 703df11

2 files changed

Lines changed: 3 additions & 6 deletions

File tree

fs/gfs2/quota.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,8 +1083,7 @@ int gfs2_quota_lock(struct gfs2_inode *ip, kuid_t uid, kgid_t gid)
10831083
u32 x;
10841084
int error;
10851085

1086-
if (sdp->sd_args.ar_quota != GFS2_QUOTA_ON &&
1087-
sdp->sd_args.ar_quota != GFS2_QUOTA_QUIET)
1086+
if (sdp->sd_args.ar_quota == GFS2_QUOTA_OFF)
10881087
return 0;
10891088

10901089
error = gfs2_quota_hold(ip, uid, gid);
@@ -1285,8 +1284,7 @@ void gfs2_quota_change(struct gfs2_inode *ip, s64 change,
12851284
u32 x;
12861285
struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode);
12871286

1288-
if ((sdp->sd_args.ar_quota != GFS2_QUOTA_ON &&
1289-
sdp->sd_args.ar_quota != GFS2_QUOTA_QUIET) ||
1287+
if (sdp->sd_args.ar_quota == GFS2_QUOTA_OFF ||
12901288
gfs2_assert_warn(sdp, change))
12911289
return;
12921290
if (ip->i_diskflags & GFS2_DIF_SYSTEM)

fs/gfs2/quota.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,7 @@ static inline int gfs2_quota_lock_check(struct gfs2_inode *ip,
5050
ret = gfs2_quota_lock(ip, NO_UID_QUOTA_CHANGE, NO_GID_QUOTA_CHANGE);
5151
if (ret)
5252
return ret;
53-
if (sdp->sd_args.ar_quota != GFS2_QUOTA_ON &&
54-
sdp->sd_args.ar_quota != GFS2_QUOTA_QUIET)
53+
if (sdp->sd_args.ar_quota == GFS2_QUOTA_ACCOUNT)
5554
return 0;
5655
ret = gfs2_quota_check(ip, ip->i_inode.i_uid, ip->i_inode.i_gid, ap);
5756
if (ret)

0 commit comments

Comments
 (0)