summaryrefslogtreecommitdiffstats
path: root/sys/geom
diff options
context:
space:
mode:
authorsmh <smh@FreeBSD.org>2015-11-23 12:17:46 +0000
committersmh <smh@FreeBSD.org>2015-11-23 12:17:46 +0000
commit7389b64286f646fbf0cf171815a7eba210da0200 (patch)
treeed4c9a65497c55cc136c46312f64878494d4b6a3 /sys/geom
parentae9fc92771cddc15c6719319a7cea22050f59af7 (diff)
downloadFreeBSD-src-7389b64286f646fbf0cf171815a7eba210da0200.zip
FreeBSD-src-7389b64286f646fbf0cf171815a7eba210da0200.tar.gz
MFC r290406:
Fix g_eli error loss conditions Sponsored by: Multiplay
Diffstat (limited to 'sys/geom')
-rw-r--r--sys/geom/eli/g_eli.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/sys/geom/eli/g_eli.c b/sys/geom/eli/g_eli.c
index 9615621..9a3713a 100644
--- a/sys/geom/eli/g_eli.c
+++ b/sys/geom/eli/g_eli.c
@@ -201,7 +201,7 @@ g_eli_read_done(struct bio *bp)
G_ELI_LOGREQ(2, bp, "Request done.");
pbp = bp->bio_parent;
- if (pbp->bio_error == 0)
+ if (pbp->bio_error == 0 && bp->bio_error != 0)
pbp->bio_error = bp->bio_error;
g_destroy_bio(bp);
/*
@@ -212,7 +212,8 @@ g_eli_read_done(struct bio *bp)
return;
sc = pbp->bio_to->geom->softc;
if (pbp->bio_error != 0) {
- G_ELI_LOGREQ(0, pbp, "%s() failed", __func__);
+ G_ELI_LOGREQ(0, pbp, "%s() failed (error=%d)", __func__,
+ pbp->bio_error);
pbp->bio_completed = 0;
if (pbp->bio_driver2 != NULL) {
free(pbp->bio_driver2, M_ELI);
@@ -241,10 +242,8 @@ g_eli_write_done(struct bio *bp)
G_ELI_LOGREQ(2, bp, "Request done.");
pbp = bp->bio_parent;
- if (pbp->bio_error == 0) {
- if (bp->bio_error != 0)
- pbp->bio_error = bp->bio_error;
- }
+ if (pbp->bio_error == 0 && bp->bio_error != 0)
+ pbp->bio_error = bp->bio_error;
g_destroy_bio(bp);
/*
* Do we have all sectors already?
@@ -255,14 +254,15 @@ g_eli_write_done(struct bio *bp)
free(pbp->bio_driver2, M_ELI);
pbp->bio_driver2 = NULL;
if (pbp->bio_error != 0) {
- G_ELI_LOGREQ(0, pbp, "Crypto WRITE request failed (error=%d).",
+ G_ELI_LOGREQ(0, pbp, "%s() failed (error=%d)", __func__,
pbp->bio_error);
pbp->bio_completed = 0;
- }
+ } else
+ pbp->bio_completed = pbp->bio_length;
+
/*
* Write is finished, send it up.
*/
- pbp->bio_completed = pbp->bio_length;
sc = pbp->bio_to->geom->softc;
g_io_deliver(pbp, pbp->bio_error);
atomic_subtract_int(&sc->sc_inflight, 1);
OpenPOWER on IntegriCloud