dm mirror: fix read error on recovery after default leg failure
authorHeinz Mauelshagen <heinzm@redhat.com>
Mon, 10 Oct 2016 15:58:32 +0000 (17:58 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Nov 2016 15:36:35 +0000 (16:36 +0100)
commitdaac9e1c85c97cbb4fc52ed9f9ab5372d407c3d1
tree3562c16bdcc1dcc6a45c2f2112f7c8f1eff396ec
parent88586a4f884c091f0746a0fd8d3d3acc0bac51f6
dm mirror: fix read error on recovery after default leg failure

commit dcb2ff56417362c31f6b430c3c531a84581e8721 upstream.

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")
Signed-off-by: Heinz Mauelshagen <heinzm@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/md/dm-raid1.c