Commit 924cade4 authored by Darrick J. Wong's avatar Darrick J. Wong

xfs: don't return garbage buffers in xfs_da3_node_read

If we're reading a node in a dir/attr btree and the buffer comes off the
disk with a magic number we don't recognize, don't ASSERT and don't set
a garbage buffer type (0 also triggers ASSERTs).  Instead, report the
corruption, release the buffer, and return -EFSCORRUPTED because that's
what the dabtree is -- corrupt.
Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: default avatarDave Chinner <dchinner@redhat.com>
parent 1f5c071d
...@@ -305,9 +305,11 @@ xfs_da3_node_read( ...@@ -305,9 +305,11 @@ xfs_da3_node_read(
type = XFS_BLFT_DIR_LEAFN_BUF; type = XFS_BLFT_DIR_LEAFN_BUF;
break; break;
default: default:
type = 0; XFS_CORRUPTION_ERROR(__func__, XFS_ERRLEVEL_LOW,
ASSERT(0); tp->t_mountp, info);
break; xfs_trans_brelse(tp, *bpp);
*bpp = NULL;
return -EFSCORRUPTED;
} }
xfs_trans_buf_set_type(tp, *bpp, type); xfs_trans_buf_set_type(tp, *bpp, type);
} }
......
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