Fix forced mdconfig -du. E.g. the following would previously

result in panic:

mdconfig -af blah.img -o force
mount /dev/md0 /mnt
mdconfig -du 0

Reviewed by:	scottl
Approved by:	rwatson (mentor)
Sponsored by:	FreeBSD Foundation
This commit is contained in:
Edward Tomasz Napierala 2008-12-16 20:59:27 +00:00
parent 3bd6a14307
commit 41c8b468e6

View File

@ -374,8 +374,11 @@ g_md_access(struct g_provider *pp, int r, int w, int e)
struct md_s *sc;
sc = pp->geom->softc;
if (sc == NULL)
if (sc == NULL) {
if (r <= 0 && w <= 0 && e <= 0)
return (0);
return (ENXIO);
}
r += pp->acr;
w += pp->acw;
e += pp->ace;