diff options
author | Darrick J. Wong <darrick.wong@oracle.com> | 2020-12-07 10:41:46 -0800 |
---|---|---|
committer | Darrick J. Wong <darrick.wong@oracle.com> | 2020-12-09 09:49:38 -0800 |
commit | a5336d6bb2d02d0e9d4d3c8be04b80b8b68d56c8 (patch) | |
tree | f5eeb7bd07bbebd4c7b0fdda47d6d3c92064697a | |
parent | 2e984badbcc0f1cf284441c566ca4309fe59ac05 (diff) | |
download | linux-a5336d6bb2d02d0e9d4d3c8be04b80b8b68d56c8.tar.gz linux-a5336d6bb2d02d0e9d4d3c8be04b80b8b68d56c8.tar.bz2 linux-a5336d6bb2d02d0e9d4d3c8be04b80b8b68d56c8.zip |
xfs: fix the forward progress assertion in xfs_iwalk_run_callbacks
In commit 27c14b5daa82 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: 27c14b5daa82 ("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>
-rw-r--r-- | fs/xfs/xfs_iwalk.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/xfs/xfs_iwalk.c b/fs/xfs/xfs_iwalk.c index 2a45138831e3..eae3aff9bc97 100644 --- a/fs/xfs/xfs_iwalk.c +++ b/fs/xfs/xfs_iwalk.c @@ -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) |