]> 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>
Thu, 16 Feb 2023 05:20:17 +0000 (10:50 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Feb 2023 11:50:38 +0000 (12:50 +0100)
commit51bd49bc9f7388411340637e1a8ccf9faf25658a
treeda2a9107e8603a8186864985bc76ecb707e9c406
parent7673599f50692d9763509fa130e18a2caf7bf507
xfs: fix the forward progress assertion in xfs_iwalk_run_callbacks

commit b7bf66fcba171ca08c4e9d587b1eef2309ff4b48 upstream.

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>
Signed-off-by: Chandan Babu R <chandan.babu@oracle.com>
Acked-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/xfs/xfs_iwalk.c