|
|
08ff87 |
From 13bb8c2daca0f1c1099ce6ba9dcb23319f7955d0 Mon Sep 17 00:00:00 2001
|
|
|
08ff87 |
From: Jan Kara <jack@suse.cz>
|
|
|
08ff87 |
Date: Wed, 20 May 2020 16:22:52 +0200
|
|
|
08ff87 |
Subject: [PATCH 2/2] Fix limits setting on XFS filesystem
|
|
|
08ff87 |
MIME-Version: 1.0
|
|
|
08ff87 |
Content-Type: text/plain; charset=UTF-8
|
|
|
08ff87 |
Content-Transfer-Encoding: 8bit
|
|
|
08ff87 |
|
|
|
08ff87 |
xfs_commit_dquot() always set FS_DQ_LIMIT_MASK when calling
|
|
|
08ff87 |
Q_XFS_SETQLIM. So far this wasn't a problem since quota tools didn't
|
|
|
08ff87 |
support setting of anything else for XFS but now that kernel will start
|
|
|
08ff87 |
supporting setting of grace times for XFS, we need to be more careful
|
|
|
08ff87 |
and set limits bits only if we really want to update them. Also
|
|
|
08ff87 |
FS_DQ_LIMIT_MASK contains real-time limits as well. Quota tools
|
|
|
08ff87 |
currently don't support them in any way so avoid telling kernel to set
|
|
|
08ff87 |
them.
|
|
|
08ff87 |
|
|
|
08ff87 |
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
|
|
|
08ff87 |
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
|
08ff87 |
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
|
|
08ff87 |
---
|
|
|
08ff87 |
quotaio_xfs.c | 4 +++-
|
|
|
08ff87 |
1 file changed, 3 insertions(+), 1 deletion(-)
|
|
|
08ff87 |
|
|
|
08ff87 |
diff --git a/quotaio_xfs.c b/quotaio_xfs.c
|
|
|
08ff87 |
index a4d6f67..3333bb1 100644
|
|
|
08ff87 |
--- a/quotaio_xfs.c
|
|
|
08ff87 |
+++ b/quotaio_xfs.c
|
|
|
08ff87 |
@@ -165,7 +165,9 @@ static int xfs_commit_dquot(struct dquot *dquot, int flags)
|
|
|
08ff87 |
if (flags & COMMIT_USAGE) /* block usage */
|
|
|
08ff87 |
xdqblk.d_fieldmask |= FS_DQ_BCOUNT;
|
|
|
08ff87 |
} else {
|
|
|
08ff87 |
- xdqblk.d_fieldmask |= FS_DQ_LIMIT_MASK;
|
|
|
08ff87 |
+ if (flags & COMMIT_LIMITS) /* warn/limit */
|
|
|
08ff87 |
+ xdqblk.d_fieldmask |= FS_DQ_BSOFT | FS_DQ_BHARD |
|
|
|
08ff87 |
+ FS_DQ_ISOFT | FS_DQ_IHARD;
|
|
|
08ff87 |
if (flags & COMMIT_TIMES) /* indiv grace period */
|
|
|
08ff87 |
xdqblk.d_fieldmask |= FS_DQ_TIMER_MASK;
|
|
|
08ff87 |
}
|
|
|
08ff87 |
--
|
|
|
08ff87 |
2.25.4
|
|
|
08ff87 |
|