Linux XFS filesystem development
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Christoph Hellwig <hch@infradead.org>
Cc: cen zhang <zzzccc427@gmail.com>,
	cem@kernel.org, linux-kernel@vger.kernel.org,
	baijiaju1990@gmail.com, zhenghaoran154@gmail.com,
	r33s3n6@gmail.com, gality365@gmail.com,
	linux-xfs@vger.kernel.org
Subject: Re: [BUG] xfs: Assertion failed in xfs_iwalk_args triggered by XFS_IOC_INUMBERS
Date: Tue, 22 Jul 2025 11:35:37 -0700	[thread overview]
Message-ID: <20250722183537.GU2672049@frogsfrogsfrogs> (raw)
In-Reply-To: <aH3fXv5tlfGtzVD1@infradead.org>

On Sun, Jul 20, 2025 at 11:34:06PM -0700, Christoph Hellwig wrote:
> The patch below should fix the issue.  But I wonder if we should split
> the flags a bit better to make things more obvious.

We did in [1], but did you have something else in mind?

[1] https://lore.kernel.org/linux-xfs/20220321051750.400056-18-chandan.babu@oracle.com/

> diff --git a/fs/xfs/xfs_itable.c b/fs/xfs/xfs_itable.c
> index c8c9b8d8309f..302efe54e2af 100644
> --- a/fs/xfs/xfs_itable.c
> +++ b/fs/xfs/xfs_itable.c
> @@ -457,7 +457,8 @@ xfs_inumbers(
>  	 * 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,
> +			breq->flags & XFS_IBULK_SAME_AG,

That's correct -- the only IBULK flag with meaning for xfs_inobt_walk is
SAME_AG because the others affect bulkstat output.

But it might be clearer to make this explicit the same way that
xfs_bulkstat does:

	unsigned int iwalk_flags = 0;

	if (breq->flags & XFS_IBULK_SAME_AG)
		iwalk_flags |= XFS_IWALK_SAME_AG;

	error = xfs_inobt_walk(..., iwalk_flags, ...);

This probably should have been included in [1] so:

Cc: <stable@vger.kernel.org> # v5.19
Fixes: 5b35d922c52798 ("xfs: Decouple XFS_IBULK flags from XFS_IWALK flags")

--D

      reply	other threads:[~2025-07-22 18:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-21  3:29 [BUG] xfs: Assertion failed in xfs_iwalk_args triggered by XFS_IOC_INUMBERS cen zhang
2025-07-21  6:34 ` Christoph Hellwig
2025-07-22 18:35   ` Darrick J. Wong [this message]

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=20250722183537.GU2672049@frogsfrogsfrogs \
    --to=djwong@kernel.org \
    --cc=baijiaju1990@gmail.com \
    --cc=cem@kernel.org \
    --cc=gality365@gmail.com \
    --cc=hch@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=r33s3n6@gmail.com \
    --cc=zhenghaoran154@gmail.com \
    --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