OSDN Git Service

xfs: don't verify buffers after IO errors
authorDave Chinner <dchinner@redhat.com>
Wed, 27 Feb 2013 02:25:54 +0000 (13:25 +1100)
committerBen Myers <bpm@sgi.com>
Thu, 7 Mar 2013 18:31:02 +0000 (12:31 -0600)
When we read a buffer, we might get an error from the underlying
block device and not the real data. Hence if we get an IO error, we
shouldn't run the verifier but instead just pass the IO error
straight through.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Mark Tinguely <tinguely@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
fs/xfs/xfs_buf.c

index 4e8f0df..50eb603 100644 (file)
@@ -1022,7 +1022,9 @@ xfs_buf_iodone_work(
        bool                    read = !!(bp->b_flags & XBF_READ);
 
        bp->b_flags &= ~(XBF_READ | XBF_WRITE | XBF_READ_AHEAD);
-       if (read && bp->b_ops)
+
+       /* only validate buffers that were read without errors */
+       if (read && bp->b_ops && !bp->b_error && (bp->b_flags & XBF_DONE))
                bp->b_ops->verify_read(bp);
 
        if (bp->b_iodone)