Skip to content

Commit 2000cab

Browse files
dgchinnergregkh
authored andcommitted
xfs: fix finobt btree block recovery ordering
[ Upstream commit 6714596 ] Nathan popped up on #xfs and pointed out that we fail to handle finobt btree blocks in xlog_recover_get_buf_lsn(). This means they always fall through the entire magic number matching code to "recover immediately". Whilst most of the time this is the correct behaviour, occasionally it will be incorrect and could potentially overwrite more recent metadata because we don't check the LSN in the on disk metadata at all. This bug has been present since the finobt was first introduced, and is a potential cause of the occasional xfs_iget_check_free_state() failures we see that indicate that the inode btree state does not match the on disk inode state. Fixes: aafc3c2 ("xfs: support the XFS_BTNUM_FINOBT free inode btree type") Reported-by: Nathan Scott <nathans@redhat.com> Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Brian Foster <bfoster@redhat.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 3e5b6a7 commit 2000cab

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

fs/xfs/xfs_buf_item_recover.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -719,6 +719,8 @@ xlog_recover_get_buf_lsn(
719719
case XFS_ABTC_MAGIC:
720720
case XFS_RMAP_CRC_MAGIC:
721721
case XFS_REFC_CRC_MAGIC:
722+
case XFS_FIBT_CRC_MAGIC:
723+
case XFS_FIBT_MAGIC:
722724
case XFS_IBT_CRC_MAGIC:
723725
case XFS_IBT_MAGIC: {
724726
struct xfs_btree_block *btb = blk;

0 commit comments

Comments
 (0)