xfs: don't return garbage buffers in xfs_da3_node_read
authorDarrick J. Wong <darrick.wong@oracle.com>
Sun, 3 Jun 2018 23:10:18 +0000 (16:10 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Mon, 4 Jun 2018 21:45:30 +0000 (14:45 -0700)
commit924cade4df49e7c9fddcbae678dbd9dee3b0aeb6
treecf1ada3976b328ba3ff31aa7803c19b17ef76614
parent1f5c071d19aef379d0876929a598adcbc7f87986
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: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
fs/xfs/libxfs/xfs_da_btree.c