summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2020-05-20 16:22:52 +0200
committerJan Kara <jack@suse.cz>2020-05-21 10:18:51 +0200
commit13bb8c2daca0f1c1099ce6ba9dcb23319f7955d0 (patch)
tree9516694a1663d45c344c0ee819a30062076a32a6
parentbe96da2353669d433b0abddb85b26ccaf35e3451 (diff)
downloadlinuxquota-13bb8c2daca0f1c1099ce6ba9dcb23319f7955d0.tar.gz
Fix limits setting on XFS filesystem
xfs_commit_dquot() always set FS_DQ_LIMIT_MASK when calling Q_XFS_SETQLIM. So far this wasn't a problem since quota tools didn't support setting of anything else for XFS but now that kernel will start supporting setting of grace times for XFS, we need to be more careful and set limits bits only if we really want to update them. Also FS_DQ_LIMIT_MASK contains real-time limits as well. Quota tools currently don't support them in any way so avoid telling kernel to set them. Reviewed-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Jan Kara <jack@suse.cz>
-rw-r--r--quotaio_xfs.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/quotaio_xfs.c b/quotaio_xfs.c
index a4d6f67..3333bb1 100644
--- a/quotaio_xfs.c
+++ b/quotaio_xfs.c
@@ -165,7 +165,9 @@ static int xfs_commit_dquot(struct dquot *dquot, int flags)
if (flags & COMMIT_USAGE) /* block usage */
xdqblk.d_fieldmask |= FS_DQ_BCOUNT;
} else {
- xdqblk.d_fieldmask |= FS_DQ_LIMIT_MASK;
+ if (flags & COMMIT_LIMITS) /* warn/limit */
+ xdqblk.d_fieldmask |= FS_DQ_BSOFT | FS_DQ_BHARD |
+ FS_DQ_ISOFT | FS_DQ_IHARD;
if (flags & COMMIT_TIMES) /* indiv grace period */
xdqblk.d_fieldmask |= FS_DQ_TIMER_MASK;
}