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: check quota files for unwritten extents
Date: Sun, 02 Oct 2022 11:20:09 -0700	[thread overview]
Message-ID: <166473480929.1083927.16868038391470181366.stgit@magnolia> (raw)
In-Reply-To: <166473480864.1083927.11062319917293302327.stgit@magnolia>

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

Teach scrub to flag quota files containing unwritten extents.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
 fs/xfs/scrub/quota.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)


diff --git a/fs/xfs/scrub/quota.c b/fs/xfs/scrub/quota.c
index d15682e2f2a3..7b21e1012eff 100644
--- a/fs/xfs/scrub/quota.c
+++ b/fs/xfs/scrub/quota.c
@@ -14,6 +14,7 @@
 #include "xfs_inode.h"
 #include "xfs_quota.h"
 #include "xfs_qm.h"
+#include "xfs_bmap.h"
 #include "scrub/scrub.h"
 #include "scrub/common.h"
 
@@ -192,11 +193,12 @@ xchk_quota_data_fork(
 	for_each_xfs_iext(ifp, &icur, &irec) {
 		if (xchk_should_terminate(sc, &error))
 			break;
+
 		/*
-		 * delalloc extents or blocks mapped above the highest
+		 * delalloc/unwritten extents or blocks mapped above the highest
 		 * quota id shouldn't happen.
 		 */
-		if (isnullstartblock(irec.br_startblock) ||
+		if (!xfs_bmap_is_written_extent(&irec) ||
 		    irec.br_startoff > max_dqid_off ||
 		    irec.br_startoff + irec.br_blockcount - 1 > max_dqid_off) {
 			xchk_fblock_set_corrupt(sc, XFS_DATA_FORK,


  parent reply	other threads:[~2022-10-02 18:31 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-02 18:20 [PATCHSET v23.1 0/6] xfs: strengthen file mapping scrub Darrick J. Wong
2022-10-02 18:20 ` [PATCH 1/6] xfs: fix perag loop in xchk_bmap_check_rmaps Darrick J. Wong
2022-10-14  4:45   ` Dave Chinner
2022-10-02 18:20 ` Darrick J. Wong [this message]
2022-10-14  5:10   ` [PATCH 4/6] xfs: check quota files for unwritten extents Dave Chinner
2022-10-02 18:20 ` [PATCH 2/6] xfs: teach scrub to check for adjacent bmaps when rmap larger than bmap Darrick J. Wong
2022-10-14  4:50   ` Dave Chinner
2022-10-02 18:20 ` [PATCH 5/6] xfs: check that CoW fork extents are not shared Darrick J. Wong
2022-10-14  5:08   ` Dave Chinner
2022-10-02 18:20 ` [PATCH 6/6] xfs: teach scrub to flag non-extents format cow forks Darrick J. Wong
2022-10-14  5:08   ` Dave Chinner
2022-10-02 18:20 ` [PATCH 3/6] xfs: block map scrub should handle incore delalloc reservations Darrick J. Wong
2022-10-14  5:07   ` Dave Chinner

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=166473480929.1083927.16868038391470181366.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).