summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2019-08-30 15:45:04 -0700
committerDarrick J. Wong <darrick.wong@oracle.com>2019-10-09 09:39:23 -0700
commitf5af145228885fd3a3fb4cf391b70f52304ca651 (patch)
tree9b20ecdf97631ae8d2ec49f7c572a3480a1a4f16
parent87b99657e20b4fc761d7e1b0485764e796881d55 (diff)
xfs: xfs_inode_free_quota_blocks should scan project quota
Buffered writers who have run out of quota reservation call xfs_inode_free_quota_blocks to try to free any space reservations that might reduce the quota usage. Unfortunately, the buffered write path treats "out of project quota" the same as "out of overall space" so this function has never supported scanning for space that might ease an "out of project quota" condition. We're about to start using this function for cases where we actually /can/ tell if we're out of project quota, so add in this functionality. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
-rw-r--r--fs/xfs/xfs_icache.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c
index e729039fd95c..ae94b8ef7be9 100644
--- a/fs/xfs/xfs_icache.c
+++ b/fs/xfs/xfs_icache.c
@@ -1562,6 +1562,15 @@ xfs_inode_free_quota_blocks(
}
}
+ if (XFS_IS_PQUOTA_ENFORCED(ip->i_mount)) {
+ dq = xfs_inode_dquot(ip, XFS_DQ_PROJ);
+ if (dq && xfs_dquot_lowsp(dq)) {
+ eofb.eof_prid = xfs_get_projid(ip);
+ eofb.eof_flags |= XFS_EOF_FLAGS_PRID;
+ do_work = true;
+ }
+ }
+
if (!do_work)
return false;