From: Christoph Hellwig <hch@lst.de>
To: Carlos Maiolino <cem@kernel.org>
Cc: cen zhang <zzzccc427@gmail.com>, linux-xfs@vger.kernel.org
Subject: [PATCH 1/2] xfs: fully decouple XFS_IBULK* flags from XFS_IWALK* flags
Date: Wed, 23 Jul 2025 14:19:44 +0200 [thread overview]
Message-ID: <20250723122011.3178474-2-hch@lst.de> (raw)
In-Reply-To: <20250723122011.3178474-1-hch@lst.de>
Fix up xfs_inumbers to now pass in the XFS_IBULK* flags into the flags
argument to xfs_inobt_walk, which expects the XFS_IWALK* flags.
Currently passing the wrong flags works for non-debug builds because
the only XFS_IWALK* flag has the same encoding as the corresponding
XFS_IBULK* flag, but in debug builds it can trigger an assert that no
incorrect flag is passed. Instead just extra the relevant flag.
Fixes: 5b35d922c52798 ("xfs: Decouple XFS_IBULK flags from XFS_IWALK flags")
Reported-by: cen zhang <zzzccc427@gmail.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
fs/xfs/xfs_itable.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/fs/xfs/xfs_itable.c b/fs/xfs/xfs_itable.c
index c8c9b8d8309f..5116842420b2 100644
--- a/fs/xfs/xfs_itable.c
+++ b/fs/xfs/xfs_itable.c
@@ -447,17 +447,21 @@ xfs_inumbers(
.breq = breq,
};
struct xfs_trans *tp;
+ unsigned int iwalk_flags = 0;
int error = 0;
if (xfs_bulkstat_already_done(breq->mp, breq->startino))
return 0;
+ if (breq->flags & XFS_IBULK_SAME_AG)
+ iwalk_flags |= XFS_IWALK_SAME_AG;
+
/*
* Grab an empty transaction so that we can use its recursive buffer
* locking abilities to detect cycles in the inobt without deadlocking.
*/
tp = xfs_trans_alloc_empty(breq->mp);
- error = xfs_inobt_walk(breq->mp, tp, breq->startino, breq->flags,
+ error = xfs_inobt_walk(breq->mp, tp, breq->startino, iwalk_flags,
xfs_inumbers_walk, breq->icount, &ic);
xfs_trans_cancel(tp);
--
2.47.2
next prev parent reply other threads:[~2025-07-23 12:20 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-23 12:19 fix XFS_IBULK_* vs XFS_IWALK_* confusion Christoph Hellwig
2025-07-23 12:19 ` Christoph Hellwig [this message]
2025-07-23 16:20 ` [PATCH 1/2] xfs: fully decouple XFS_IBULK* flags from XFS_IWALK* flags Darrick J. Wong
2025-08-05 9:23 ` Carlos Maiolino
2025-07-23 12:19 ` [PATCH 2/2] xfs: remove XFS_IBULK_SAME_AG Christoph Hellwig
2025-07-23 16:21 ` Darrick J. Wong
2025-08-12 7:33 ` fix XFS_IBULK_* vs XFS_IWALK_* confusion Carlos Maiolino
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=20250723122011.3178474-2-hch@lst.de \
--to=hch@lst.de \
--cc=cem@kernel.org \
--cc=linux-xfs@vger.kernel.org \
--cc=zzzccc427@gmail.com \
/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).