From b3b3d1b7fed57988515ef7b2ae133982d6c5714b Mon Sep 17 00:00:00 2001 From: Poul-Henning Kamp Date: Tue, 11 Feb 2003 12:35:44 +0000 Subject: [PATCH] Mark our provider with G_PF_CANDELETE in the cases where this is actually the case. --- sys/dev/md/md.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/sys/dev/md/md.c b/sys/dev/md/md.c index 65ae4de1d18a..75f76ee373c2 100644 --- a/sys/dev/md/md.c +++ b/sys/dev/md/md.c @@ -782,11 +782,14 @@ mdcreate_malloc(struct md_ioctl *mdio) break; } } - if (!error) { - mdinit(sc); - } else + if (error) { mddestroy(sc, NULL); - return (error); + return (error); + } + mdinit(sc); + if (!(mdio->md_options & MD_RESERVE)) + sc->pp->flags |= G_PF_CANDELETE; + return (0); } @@ -989,11 +992,14 @@ mdcreate_swap(struct md_ioctl *mdio, struct thread *td) } } error = mdsetcred(sc, td->td_ucred); - if (error) + if (error) { mddestroy(sc, td); - else - mdinit(sc); - return (error); + return (error); + } + mdinit(sc); + if (!(mdio->md_options & MD_RESERVE)) + sc->pp->flags |= G_PF_CANDELETE; + return (0); } static int