Skip to content

Commit a5336d6

Browse files
committed
xfs: fix the forward progress assertion in xfs_iwalk_run_callbacks
In commit 27c14b5 we started tracking the last inode seen during an inode walk to avoid infinite loops if a corrupt inobt record happens to have a lower ir_startino than the record preceeding it. Unfortunately, the assertion trips over the case where there are completely empty inobt records (which can happen quite easily on 64k page filesystems) because we advance the tracking cursor without actually putting the empty record into the processing buffer. Fix the assert to allow for this case. Reported-by: zlang@redhat.com Fixes: 27c14b5 ("xfs: ensure inobt record walks always make forward progress") Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Zorro Lang <zlang@redhat.com> Reviewed-by: Dave Chinner <dchinner@redhat.com>
1 parent 2e984ba commit a5336d6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/xfs/xfs_iwalk.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ xfs_iwalk_run_callbacks(
363363
/* Delete cursor but remember the last record we cached... */
364364
xfs_iwalk_del_inobt(tp, curpp, agi_bpp, 0);
365365
irec = &iwag->recs[iwag->nr_recs - 1];
366-
ASSERT(next_agino == irec->ir_startino + XFS_INODES_PER_CHUNK);
366+
ASSERT(next_agino >= irec->ir_startino + XFS_INODES_PER_CHUNK);
367367

368368
error = xfs_iwalk_ag_recs(iwag);
369369
if (error)

0 commit comments

Comments
 (0)