]> git.baikalelectronics.ru Git - kernel.git/commit
xfs: check magic numbers in dir3 leaf verifier first
authorDave Chinner <david@fromorbit.com>
Tue, 3 Sep 2013 00:06:58 +0000 (10:06 +1000)
committerBen Myers <bpm@sgi.com>
Mon, 9 Sep 2013 22:43:58 +0000 (17:43 -0500)
commit44fd5bc7be809173f234b2eb9905e918b262db64
treea5909bdca6ea1a287717d6b88dc76b4fd72f3688
parent4297ba9c5524179663e6afc9d6f071909345e496
xfs: check magic numbers in dir3 leaf verifier first

Calling xfs_dir3_leaf_hdr_from_disk() in a verifier before
validating the magic numbers in the buffer results in ASSERT
failures due to mismatching magic numbers when a corruption occurs.
Seeing as the verifier is supposed to catch the corruption and pass
it back to the caller, having the verifier assert fail on error
defeats the purpose of detecting the errors in the first place.

Check the magic numbers direct from the buffer before decoding the
header.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Ben Myers <bpm@sgi.com>
fs/xfs/xfs_dir2_leaf.c