xfs: fix the forward progress assertion in xfs_iwalk_run_callbacks
authorDarrick J. Wong <darrick.wong@oracle.com>
Mon, 7 Dec 2020 18:41:46 +0000 (10:41 -0800)
committerDarrick J. Wong <darrick.wong@oracle.com>
Wed, 9 Dec 2020 17:49:38 +0000 (09:49 -0800)
commita5336d6bb2d02d0e9d4d3c8be04b80b8b68d56c8
treef5eeb7bd07bbebd4c7b0fdda47d6d3c92064697a
parent2e984badbcc0f1cf284441c566ca4309fe59ac05
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>
fs/xfs/xfs_iwalk.c