Commit d7e5e374 authored by Konstantin Belousov's avatar Konstantin Belousov
Browse files

softdep_unmount: handle spurious wakeups

Reviewed by:	mckusick
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D29178
parent fabbc3d8
......@@ -2805,10 +2805,13 @@ softdep_unmount(mp)
ACQUIRE_LOCK(ump);
ump->softdep_flags |= FLUSH_EXIT;
wakeup(&ump->softdep_flushtd);
msleep(&ump->softdep_flags, LOCK_PTR(ump), PVM | PDROP,
"sdwait", 0);
while ((ump->softdep_flags & FLUSH_EXIT) != 0) {
msleep(&ump->softdep_flags, LOCK_PTR(ump), PVM,
"sdwait", 0);
}
KASSERT((ump->softdep_flags & FLUSH_EXIT) == 0,
("Thread shutdown failed"));
FREE_LOCK(ump);
}
/*
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment