summaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-raid1.c
diff options
context:
space:
mode:
authorHeinz Mauelshagen <heinzm@redhat.com>2016-10-10 17:58:32 +0200
committerMike Snitzer <snitzer@redhat.com>2016-10-14 11:54:10 -0400
commitdcb2ff56417362c31f6b430c3c531a84581e8721 (patch)
tree3fcab8dac06f6f5a2ee3c62c3e2577da403547e5 /drivers/md/dm-raid1.c
parent5c33677c87cbe44ae04df69c4a29c1750a9ec4e5 (diff)
downloadlinux-dcb2ff56417362c31f6b430c3c531a84581e8721.tar.gz
linux-dcb2ff56417362c31f6b430c3c531a84581e8721.tar.bz2
linux-dcb2ff56417362c31f6b430c3c531a84581e8721.zip
dm mirror: fix read error on recovery after default leg failure
If a default leg has failed, any read will cause a new operational default leg to be selected and the read is resubmitted. But until now the read will return failure even though it was successful due to resubmission. The reason for this is bio->bi_error was not being cleared before resubmitting the bio. Fix by clearing bio->bi_error before resubmission. Fixes: 4246a0b63bd8 ("block: add a bi_error field to struct bio") Cc: stable@vger.kernel.org # 4.3+ Signed-off-by: Heinz Mauelshagen <heinzm@redhat.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to 'drivers/md/dm-raid1.c')
-rw-r--r--drivers/md/dm-raid1.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/md/dm-raid1.c b/drivers/md/dm-raid1.c
index bdf1606f67bc..7a6254d54baf 100644
--- a/drivers/md/dm-raid1.c
+++ b/drivers/md/dm-raid1.c
@@ -1292,6 +1292,7 @@ static int mirror_end_io(struct dm_target *ti, struct bio *bio, int error)
dm_bio_restore(bd, bio);
bio_record->details.bi_bdev = NULL;
+ bio->bi_error = 0;
queue_bio(ms, bio, rw);
return DM_ENDIO_INCOMPLETE;