git: f59d0c7c58f1 - stable/13 - softdep_unmount: handle spurious wakeups
Konstantin Belousov
kib at FreeBSD.org
Sat Aug 14 10:22:28 UTC 2021
The branch stable/13 has been updated by kib:
URL: https://cgit.FreeBSD.org/src/commit/?id=f59d0c7c58f1b0ee32675be915dfc9eac7d0044d
commit f59d0c7c58f1b0ee32675be915dfc9eac7d0044d
Author: Konstantin Belousov <kib at FreeBSD.org>
AuthorDate: 2021-02-28 22:46:21 +0000
Commit: Konstantin Belousov <kib at 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);
}
/*
More information about the dev-commits-src-all
mailing list