From fd440d3089dc9c78d7f7f1e974e5618ea166845f Mon Sep 17 00:00:00 2001 From: Eugene Grosbein Date: Sun, 10 Dec 2017 13:45:41 +0000 Subject: [PATCH] MFC r326655,326668: correct error handling for graid SINGLE/CONCAT/RAID5 volumes. Approved by: mav (mentor) --- sys/geom/raid/tr_concat.c | 2 +- sys/geom/raid/tr_raid5.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/geom/raid/tr_concat.c b/sys/geom/raid/tr_concat.c index 44951d444785..717ff1d56498 100644 --- a/sys/geom/raid/tr_concat.c +++ b/sys/geom/raid/tr_concat.c @@ -339,7 +339,7 @@ g_raid_tr_iodone_concat(struct g_raid_tr_object *tr, pbp->bio_inbed++; if (pbp->bio_children == pbp->bio_inbed) { pbp->bio_completed = pbp->bio_length; - g_raid_iodone(pbp, bp->bio_error); + g_raid_iodone(pbp, pbp->bio_error); } } diff --git a/sys/geom/raid/tr_raid5.c b/sys/geom/raid/tr_raid5.c index c90845e51376..4e958a050d20 100644 --- a/sys/geom/raid/tr_raid5.c +++ b/sys/geom/raid/tr_raid5.c @@ -371,15 +371,15 @@ g_raid_tr_iodone_raid5(struct g_raid_tr_object *tr, struct g_raid_subdisk *sd, struct bio *bp) { struct bio *pbp; - int error; pbp = bp->bio_parent; + if (pbp->bio_error == 0) + pbp->bio_error = bp->bio_error; pbp->bio_inbed++; - error = bp->bio_error; g_destroy_bio(bp); if (pbp->bio_children == pbp->bio_inbed) { pbp->bio_completed = pbp->bio_length; - g_raid_iodone(pbp, error); + g_raid_iodone(pbp, pbp->bio_error); } }