summaryrefslogtreecommitdiffstats
path: root/sys/geom/geom_subr.c
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2004-07-08 10:34:09 +0000
committerphk <phk@FreeBSD.org>2004-07-08 10:34:09 +0000
commita0a019560285a370a4c3a2564b708f770f7f597d (patch)
treec7c9acd5c30fb17b0bb581a48bbe900992f2eac3 /sys/geom/geom_subr.c
parent54adde43e3db43893e9824235a81823cf679c051 (diff)
downloadFreeBSD-src-a0a019560285a370a4c3a2564b708f770f7f597d.zip
FreeBSD-src-a0a019560285a370a4c3a2564b708f770f7f597d.tar.gz
Fail normally rather than KASSERT if attempt to open a spoiled consumer.
Diffstat (limited to 'sys/geom/geom_subr.c')
-rw-r--r--sys/geom/geom_subr.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/sys/geom/geom_subr.c b/sys/geom/geom_subr.c
index cf8671d..aea06f6 100644
--- a/sys/geom/geom_subr.c
+++ b/sys/geom/geom_subr.c
@@ -601,11 +601,9 @@ g_access(struct g_consumer *cp, int dcr, int dcw, int dce)
* are probably just ahead of the event telling us that. Fail
* now rather than having to unravel this later.
*/
- if (cp->geom->spoiled != NULL && cp->spoiled) {
- KASSERT(dcr <= 0, ("spoiled but dcr = %d", dcr));
- KASSERT(dcw <= 0, ("spoiled but dcw = %d", dcw));
- KASSERT(dce <= 0, ("spoiled but dce = %d", dce));
- }
+ if (cp->geom->spoiled != NULL && cp->spoiled &&
+ (dcr > 0 || dcw > 0 || dce > 0))
+ return (ENXIO);
/*
* Figure out what counts the provider would have had, if this
OpenPOWER on IntegriCloud