@@ -1169,7 +1169,7 @@ static int mirror_map(struct dm_target *ti, struct bio *bio)
*/
if (!r || (r == -EWOULDBLOCK)) {
if (rw == READA)
- return -EWOULDBLOCK;
+ return -EIO;
queue_bio(ms, bio, rw);
return DM_MAPIO_SUBMITTED;
@@ -1024,7 +1024,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)