From: Darrick J. Wong Date: Wed, 2 Sep 2015 22:41:33 +0000 (+1000) Subject: libxfs: verifier should set buffer error when da block has a bad magic number X-Git-Tag: v4.2.0~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7fc5180d0f4af5260c67ed6d82ff1cba8fb9113c;p=thirdparty%2Fxfsprogs-dev.git libxfs: verifier should set buffer error when da block has a bad magic number If xfs_da3_node_read_verify() doesn't recognize the magic number of a buffer it's just read, set the buffer error to -EFSCORRUPTED so that the error can be sent up to userspace. Without this patch we'll notice the bad magic eventually while trying to traverse or change the block, but we really ought to fail early in the verifier. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner Signed-off-by: Dave Chinner --- diff --git a/libxfs/xfs_da_btree.c b/libxfs/xfs_da_btree.c index c874164fa..289dc1e03 100644 --- a/libxfs/xfs_da_btree.c +++ b/libxfs/xfs_da_btree.c @@ -229,6 +229,7 @@ xfs_da3_node_read_verify( bp->b_ops->verify_read(bp); return; default: + xfs_buf_ioerror(bp, -EFSCORRUPTED); break; }