Skip to content

Commit a977920

Browse files
Christoph Hellwiggregkh
authored andcommitted
xfs: fully decouple XFS_IBULK* flags from XFS_IWALK* flags
[ Upstream commit d284551 ] 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: 5b35d92 ("xfs: Decouple XFS_IBULK flags from XFS_IWALK flags") Cc: <stable@vger.kernel.org> # v5.19 Reported-by: cen zhang <zzzccc427@gmail.com> Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Carlos Maiolino <cem@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 6224b3c commit a977920

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

fs/xfs/xfs_itable.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,17 +447,21 @@ xfs_inumbers(
447447
.breq = breq,
448448
};
449449
struct xfs_trans *tp;
450+
unsigned int iwalk_flags = 0;
450451
int error = 0;
451452

452453
if (xfs_bulkstat_already_done(breq->mp, breq->startino))
453454
return 0;
454455

456+
if (breq->flags & XFS_IBULK_SAME_AG)
457+
iwalk_flags |= XFS_IWALK_SAME_AG;
458+
455459
/*
456460
* Grab an empty transaction so that we can use its recursive buffer
457461
* locking abilities to detect cycles in the inobt without deadlocking.
458462
*/
459463
tp = xfs_trans_alloc_empty(breq->mp);
460-
error = xfs_inobt_walk(breq->mp, tp, breq->startino, breq->flags,
464+
error = xfs_inobt_walk(breq->mp, tp, breq->startino, iwalk_flags,
461465
xfs_inumbers_walk, breq->icount, &ic);
462466
xfs_trans_cancel(tp);
463467

0 commit comments

Comments
 (0)