summaryrefslogtreecommitdiffstats
path: root/sys/geom/raid3/g_raid3.c
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2006-07-03 10:32:38 +0000
committerpjd <pjd@FreeBSD.org>2006-07-03 10:32:38 +0000
commit444d196b29d0924581598414ae1f1d1811506324 (patch)
tree4f634d3e2a484a657730db409940effeec7970f4 /sys/geom/raid3/g_raid3.c
parentfa2514423bf205fcd4d5d552ebe38852f9457594 (diff)
downloadFreeBSD-src-444d196b29d0924581598414ae1f1d1811506324.zip
FreeBSD-src-444d196b29d0924581598414ae1f1d1811506324.tar.gz
Allow to close access even if device is already destroyed.
Reported by: Ulrich Spoerlein <uspoerlein@gmail.com> PR: kern/98093 MFC after: 1 week
Diffstat (limited to 'sys/geom/raid3/g_raid3.c')
-rw-r--r--sys/geom/raid3/g_raid3.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/geom/raid3/g_raid3.c b/sys/geom/raid3/g_raid3.c
index e184972..11d82c6 100644
--- a/sys/geom/raid3/g_raid3.c
+++ b/sys/geom/raid3/g_raid3.c
@@ -2949,13 +2949,15 @@ g_raid3_access(struct g_provider *pp, int acr, int acw, int ace)
G_RAID3_DEBUG(2, "Access request for %s: r%dw%de%d.", pp->name, acr,
acw, ace);
+ sc = pp->geom->softc;
+ if (sc == NULL && acr <= 0 && acw <= 0 && ace <= 0)
+ return (0);
+ KASSERT(sc != NULL, ("NULL softc (provider=%s).", pp->name));
+
dcr = pp->acr + acr;
dcw = pp->acw + acw;
dce = pp->ace + ace;
- sc = pp->geom->softc;
- KASSERT(sc != NULL, ("NULL softc (provider=%s).", pp->name));
-
g_topology_unlock();
sx_xlock(&sc->sc_lock);
if ((sc->sc_flags & G_RAID3_DEVICE_FLAG_DESTROY) != 0 ||
OpenPOWER on IntegriCloud