Skip to content

Commit

Permalink
xfs: fix the forward progress assertion in xfs_iwalk_run_callbacks
Browse files Browse the repository at this point in the history
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: [email protected]
Fixes: 27c14b5 ("xfs: ensure inobt record walks always make forward progress")
Signed-off-by: Darrick J. Wong <[email protected]>
Reviewed-by: Zorro Lang <[email protected]>
Reviewed-by: Dave Chinner <[email protected]>
  • Loading branch information
djwong committed Dec 9, 2020
1 parent 2e984ba commit a5336d6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/xfs/xfs_iwalk.c
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ xfs_iwalk_run_callbacks(
/* Delete cursor but remember the last record we cached... */
xfs_iwalk_del_inobt(tp, curpp, agi_bpp, 0);
irec = &iwag->recs[iwag->nr_recs - 1];
ASSERT(next_agino == irec->ir_startino + XFS_INODES_PER_CHUNK);
ASSERT(next_agino >= irec->ir_startino + XFS_INODES_PER_CHUNK);

error = xfs_iwalk_ag_recs(iwag);
if (error)
Expand Down

0 comments on commit a5336d6

Please sign in to comment.