Avoid unlocking unlocked mutex in RCTL jail code. Specific test case

is attached to PR.

PR:		193457
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
This commit is contained in:
Edward Tomasz Napierala 2014-09-09 16:05:33 +00:00
parent 4f3fe448f5
commit f514b97b7d

View File

@ -1812,9 +1812,11 @@ kern_jail_set(struct thread *td, struct uio *optuio, int flags)
#ifdef RACCT
if (!created) {
sx_sunlock(&allprison_lock);
if (!(flags & JAIL_ATTACH))
sx_sunlock(&allprison_lock);
prison_racct_modify(pr);
sx_slock(&allprison_lock);
if (!(flags & JAIL_ATTACH))
sx_slock(&allprison_lock);
}
#endif