linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: djwong@kernel.org
Cc: linux-xfs@vger.kernel.org
Subject: [PATCH 4/6] xfs: xfs_inode_free_quota_blocks should scan project quota
Date: Mon, 11 Jan 2021 15:22:58 -0800	[thread overview]
Message-ID: <161040737875.1582114.10240657258164907570.stgit@magnolia> (raw)
In-Reply-To: <161040735389.1582114.15084485390769234805.stgit@magnolia>

From: Darrick J. Wong <djwong@kernel.org>

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 <djwong@kernel.org>
---
 fs/xfs/xfs_icache.c |    9 +++++++++
 1 file changed, 9 insertions(+)


diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c
index 4e226827b33d..703d26d04e0f 100644
--- a/fs/xfs/xfs_icache.c
+++ b/fs/xfs/xfs_icache.c
@@ -1453,6 +1453,15 @@ xfs_inode_free_quota_blocks(
 		}
 	}
 
+	if (XFS_IS_PQUOTA_ENFORCED(ip->i_mount)) {
+		dq = xfs_inode_dquot(ip, XFS_DQTYPE_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;
 


  parent reply	other threads:[~2021-01-12  0:30 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-11 23:22 [PATCHSET v2 0/6] xfs: try harder to reclaim space when we run out Darrick J. Wong
2021-01-11 23:22 ` [PATCH 1/6] xfs: hide most of the incore inode walk interface Darrick J. Wong
2021-01-13 14:34   ` Christoph Hellwig
2021-01-18 19:50     ` Darrick J. Wong
2021-01-11 23:22 ` [PATCH 2/6] xfs: refactor messy xfs_inode_free_quota_* functions Darrick J. Wong
2021-01-13 14:37   ` Christoph Hellwig
2021-01-11 23:22 ` [PATCH 3/6] xfs: don't stall cowblocks scan if we can't take locks Darrick J. Wong
2021-01-13 14:43   ` Christoph Hellwig
2021-01-14 21:54     ` Darrick J. Wong
2021-01-18 17:34       ` Christoph Hellwig
2021-01-18 19:37         ` Darrick J. Wong
2021-01-18 19:39           ` Christoph Hellwig
2021-01-18 19:44             ` Darrick J. Wong
2021-01-18 19:51               ` Christoph Hellwig
2021-01-11 23:22 ` Darrick J. Wong [this message]
2021-01-13 14:45   ` [PATCH 4/6] xfs: xfs_inode_free_quota_blocks should scan project quota Christoph Hellwig
2021-01-11 23:23 ` [PATCH 5/6] xfs: flush speculative space allocations when we run out of quota Darrick J. Wong
2021-01-12  1:22   ` Dave Chinner
2021-01-12  1:31     ` Darrick J. Wong
2021-01-12  1:40       ` Dave Chinner
2021-01-12  2:18         ` Darrick J. Wong
2021-01-14 22:10           ` Darrick J. Wong
2021-01-11 23:23 ` [PATCH 6/6] xfs: flush speculative space allocations when we run out of space Darrick J. Wong
  -- strict thread matches above, loose matches on Subject: below --
2020-01-01  1:07 [PATCH v2 0/6] xfs: try harder to reclaim space when we run out Darrick J. Wong
2020-01-01  1:07 ` [PATCH 4/6] xfs: xfs_inode_free_quota_blocks should scan project quota Darrick J. Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=161040737875.1582114.10240657258164907570.stgit@magnolia \
    --to=djwong@kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).