The branch main has been updated by kib:

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

commit d7e5e374167fe98e998b80691824750f44bb050d
Author:     Konstantin Belousov <k...@freebsd.org>
AuthorDate: 2021-02-28 22:46:21 +0000
Commit:     Konstantin Belousov <k...@freebsd.org>
CommitDate: 2021-03-12 11:31:08 +0000

    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
---
 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 4e20652973b4..cb0be9d21529 100644
--- a/sys/ufs/ffs/ffs_softdep.c
+++ b/sys/ufs/ffs/ffs_softdep.c
@@ -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);
        }
 
        /*
_______________________________________________
dev-commits-src-main@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-main
To unsubscribe, send any mail to "dev-commits-src-main-unsubscr...@freebsd.org"

Reply via email to