Date: Sat, 14 Aug 2021 10:22:27 GMT From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: f59d0c7c58f1 - stable/13 - softdep_unmount: handle spurious wakeups Message-ID: <202108141022.17EAMRX6029784@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=f59d0c7c58f1b0ee32675be915dfc9eac7d0044d commit f59d0c7c58f1b0ee32675be915dfc9eac7d0044d Author: Konstantin Belousov <kib@FreeBSD.org> AuthorDate: 2021-02-28 22:46:21 +0000 Commit: Konstantin Belousov <kib@FreeBSD.org> CommitDate: 2021-08-14 10:21:58 +0000 softdep_unmount: handle spurious wakeups (cherry picked from commit d7e5e374167fe98e998b80691824750f44bb050d) --- sys/ufs/ffs/ffs_softdep.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index fbb5c0cbc727..c904336af2e4 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -2802,10 +2802,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); } /*
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202108141022.17EAMRX6029784>