Date: Sun, 30 Sep 2018 12:25:38 +0000 (UTC) From: Mariusz Zaborski <oshogbo@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r339023 - stable/11/sys/geom/eli Message-ID: <201809301225.w8UCPcOR022953@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: oshogbo Date: Sun Sep 30 12:25:38 2018 New Revision: 339023 URL: https://svnweb.freebsd.org/changeset/base/339023 Log: MFC r336310: Let geli deal with lost devices without crashing. PR: 162036 Submitted by: Fabian Keil <fk@fabiankeil.de> Obtained from: ElectroBSD Discussed with: pjd@ Modified: stable/11/sys/geom/eli/g_eli.c stable/11/sys/geom/eli/g_eli_privacy.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/geom/eli/g_eli.c ============================================================================== --- stable/11/sys/geom/eli/g_eli.c Sun Sep 30 12:16:06 2018 (r339022) +++ stable/11/sys/geom/eli/g_eli.c Sun Sep 30 12:25:38 2018 (r339023) @@ -252,7 +252,8 @@ g_eli_read_done(struct bio *bp) pbp->bio_driver2 = NULL; } g_io_deliver(pbp, pbp->bio_error); - atomic_subtract_int(&sc->sc_inflight, 1); + if (sc != NULL) + atomic_subtract_int(&sc->sc_inflight, 1); return; } mtx_lock(&sc->sc_queue_mtx); @@ -297,7 +298,8 @@ g_eli_write_done(struct bio *bp) */ sc = pbp->bio_to->geom->softc; g_io_deliver(pbp, pbp->bio_error); - atomic_subtract_int(&sc->sc_inflight, 1); + if (sc != NULL) + atomic_subtract_int(&sc->sc_inflight, 1); } /* Modified: stable/11/sys/geom/eli/g_eli_privacy.c ============================================================================== --- stable/11/sys/geom/eli/g_eli_privacy.c Sun Sep 30 12:16:06 2018 (r339022) +++ stable/11/sys/geom/eli/g_eli_privacy.c Sun Sep 30 12:25:38 2018 (r339023) @@ -87,7 +87,8 @@ g_eli_crypto_read_done(struct cryptop *crp) bp->bio_error = crp->crp_etype; } sc = bp->bio_to->geom->softc; - g_eli_key_drop(sc, crp->crp_desc->crd_key); + if (sc != NULL) + g_eli_key_drop(sc, crp->crp_desc->crd_key); /* * Do we have all sectors already? */ @@ -104,7 +105,8 @@ g_eli_crypto_read_done(struct cryptop *crp) * Read is finished, send it up. */ g_io_deliver(bp, bp->bio_error); - atomic_subtract_int(&sc->sc_inflight, 1); + if (sc != NULL) + atomic_subtract_int(&sc->sc_inflight, 1); return (0); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201809301225.w8UCPcOR022953>