mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-12-04 23:19:00 +00:00
Fail normally rather than KASSERT if attempt to open a spoiled consumer.
This commit is contained in:
parent
89b74d5cd5
commit
4fa0290fbf
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=131798
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user