Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

libxfs: bad magic number should set da block buffer error

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 <darrick.wong@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>

authored by

Darrick J. Wong and committed by
Dave Chinner
dfdd4ac6 bc0195aa

+1
+1
fs/xfs/libxfs/xfs_da_btree.c
··· 233 233 bp->b_ops->verify_read(bp); 234 234 return; 235 235 default: 236 + xfs_buf_ioerror(bp, -EFSCORRUPTED); 236 237 break; 237 238 } 238 239