From 4fa0290fbf8a675f3129f4872060d4785c108622 Mon Sep 17 00:00:00 2001 From: Poul-Henning Kamp Date: Thu, 8 Jul 2004 10:34:09 +0000 Subject: [PATCH] Fail normally rather than KASSERT if attempt to open a spoiled consumer. --- sys/geom/geom_subr.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/sys/geom/geom_subr.c b/sys/geom/geom_subr.c index cf8671d34f4d..aea06f68ade8 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