The branch stable/13 has been updated by kib:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=f59d0c7c58f1b0ee32675be915dfc9eac7d0044d

commit f59d0c7c58f1b0ee32675be915dfc9eac7d0044d
Author:     Konstantin Belousov <[email protected]>
AuthorDate: 2021-02-28 22:46:21 +0000
Commit:     Konstantin Belousov <[email protected]>
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);
        }
 
        /*
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to