summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2020-02-19 17:02:03 -0800
committerDarrick J. Wong <darrick.wong@oracle.com>2020-06-01 21:16:35 -0700
commit72d96707db7e31a622fc27485bdb0a6ed5451ef0 (patch)
tree900e9a9c7202d1e8f9f30c97b3bab7853e311ebb
parent17c5964752d9358aaeaf8be75764d510c20eeca8 (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 0da5bdf61e38..8993a4ccb879 100644
--- a/fs/xfs/xfs_icache.c
+++ b/fs/xfs/xfs_icache.c
@@ -1588,6 +1588,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 = ip->i_d.di_projid;
+ eofb.eof_flags |= XFS_EOF_FLAGS_PRID;
+ do_work = true;
+ }
+ }
+
if (!do_work)
return false;