Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Mar 2021 11:32:23 GMT
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: d7e5e374167f - main - softdep_unmount: handle spurious wakeups
Message-ID:  <202103121132.12CBWN1X077429@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by kib:

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

commit d7e5e374167fe98e998b80691824750f44bb050d
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2021-02-28 22:46:21 +0000
Commit:     Konstantin Belousov <kib@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);
 	}
 
 	/*



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202103121132.12CBWN1X077429>