]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitb7bf66fcba171ca08c4e9d587b1eef2309ff4b48
treef5eeb7bd07bbebd4c7b0fdda47d6d3c92064697a
parent3fa136130141426826193ef19f9c10552a4756e4
xfs: fix the forward progress assertion in xfs_iwalk_run_callbacks

In commit 6c80b904a2f9 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: 6c80b904a2f9 ("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