]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
libxfs: verifier should set buffer error when da block has a bad magic number
authorDarrick J. Wong <darrick.wong@oracle.com>
Wed, 2 Sep 2015 22:41:33 +0000 (08:41 +1000)
committerDave Chinner <david@fromorbit.com>
Wed, 2 Sep 2015 22:41:33 +0000 (08:41 +1000)
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>
libxfs/xfs_da_btree.c

index c874164fa8214df2484e464db50ce29e376d2412..289dc1e03dd5c920893231338535102694e60365 100644 (file)
@@ -229,6 +229,7 @@ xfs_da3_node_read_verify(
                        bp->b_ops->verify_read(bp);
                        return;
                default:
+                       xfs_buf_ioerror(bp, -EFSCORRUPTED);
                        break;
        }