Commit 67145967 authored by Dave Chinner's avatar Dave Chinner Committed by Darrick J. Wong

xfs: fix finobt btree block recovery ordering

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: aafc3c24 ("xfs: support the XFS_BTNUM_FINOBT free inode btree type")
Reported-by: default avatarNathan Scott <nathans@redhat.com>
Signed-off-by: default avatarDave Chinner <dchinner@redhat.com>
Reviewed-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: default avatarBrian Foster <bfoster@redhat.com>
parent 3442de9c
...@@ -719,6 +719,8 @@ xlog_recover_get_buf_lsn( ...@@ -719,6 +719,8 @@ xlog_recover_get_buf_lsn(
case XFS_ABTC_MAGIC: case XFS_ABTC_MAGIC:
case XFS_RMAP_CRC_MAGIC: case XFS_RMAP_CRC_MAGIC:
case XFS_REFC_CRC_MAGIC: case XFS_REFC_CRC_MAGIC:
case XFS_FIBT_CRC_MAGIC:
case XFS_FIBT_MAGIC:
case XFS_IBT_CRC_MAGIC: case XFS_IBT_CRC_MAGIC:
case XFS_IBT_MAGIC: { case XFS_IBT_MAGIC: {
struct xfs_btree_block *btb = blk; struct xfs_btree_block *btb = blk;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment