Fail normally rather than KASSERT if attempt to open a spoiled consumer.

This commit is contained in:
Poul-Henning Kamp 2004-07-08 10:34:09 +00:00
parent 89b74d5cd5
commit 4fa0290fbf
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=131798

View File

@ -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