From 2a549507134a4ffba7fb3859bd397f7b42a0964a Mon Sep 17 00:00:00 2001 From: Jamie Gritton Date: Mon, 25 Apr 2016 03:58:08 +0000 Subject: [PATCH] Remove the PR_REMOVE flag, which was meant as a temporary marker for a jail that might be seen mid-removal. It hasn't been doing the right thing since at least the ability to resurrect dying jails, and such resurrection also makes it unnecessary. --- sys/kern/kern_jail.c | 4 +--- sys/sys/jail.h | 1 - 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/sys/kern/kern_jail.c b/sys/kern/kern_jail.c index 3e4f79833fc..336abd57825 100644 --- a/sys/kern/kern_jail.c +++ b/sys/kern/kern_jail.c @@ -1222,7 +1222,7 @@ kern_jail_set(struct thread *td, struct uio *optuio, int flags) } created = 1; mtx_lock(&ppr->pr_mtx); - if (ppr->pr_ref == 0 || (ppr->pr_flags & PR_REMOVE)) { + if (ppr->pr_ref == 0) { mtx_unlock(&ppr->pr_mtx); error = ENOENT; vfs_opterror(opts, "parent jail went away!"); @@ -2273,7 +2273,6 @@ sys_jail_remove(struct thread *td, struct jail_remove_args *uap) /* Remove all descendants of this prison, then remove this prison. */ pr->pr_ref++; - pr->pr_flags |= PR_REMOVE; if (!LIST_EMPTY(&pr->pr_children)) { mtx_unlock(&pr->pr_mtx); lpr = NULL; @@ -2282,7 +2281,6 @@ sys_jail_remove(struct thread *td, struct jail_remove_args *uap) if (cpr->pr_ref > 0) { tpr = cpr; cpr->pr_ref++; - cpr->pr_flags |= PR_REMOVE; } else { /* Already removed - do not do it again. */ tpr = NULL; diff --git a/sys/sys/jail.h b/sys/sys/jail.h index 2c88366eb15..41730cdae43 100644 --- a/sys/sys/jail.h +++ b/sys/sys/jail.h @@ -210,7 +210,6 @@ struct prison_racct { /* primary jail address. */ /* Internal flag bits */ -#define PR_REMOVE 0x01000000 /* In process of being removed */ #define PR_IP4 0x02000000 /* IPv4 restricted or disabled */ /* by this jail or an ancestor */ #define PR_IP6 0x04000000 /* IPv6 restricted or disabled */