Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 14 Aug 2021 10:22:26 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: a326a8f616e9 - stable/13 - softdep_flush(): do not access ump after we acked FLUSH_EXIT and unlocked SU lock
Message-ID:  <202108141022.17EAMQZj029760@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=a326a8f616e9fc0b7ec4024e555261485fc1b1e1

commit a326a8f616e9fc0b7ec4024e555261485fc1b1e1
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2021-02-28 22:45:04 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2021-08-14 10:21:58 +0000

    softdep_flush(): do not access ump after we acked FLUSH_EXIT and unlocked SU lock
    
    (cherry picked from commit fabbc3d879cce5c37df25707107a0fcb64267346)
---
 sys/ufs/ffs/ffs_softdep.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c
index 3fd5476df17d..fbb5c0cbc727 100644
--- a/sys/ufs/ffs/ffs_softdep.c
+++ b/sys/ufs/ffs/ffs_softdep.c
@@ -1568,6 +1568,7 @@ softdep_flush(addr)
 	struct mount *mp;
 	struct thread *td;
 	struct ufsmount *ump;
+	int cleanups;
 
 	td = curthread;
 	td->td_pflags |= TDP_NORUNNINGBUF;
@@ -1602,10 +1603,14 @@ softdep_flush(addr)
 			continue;
 		}
 		ump->softdep_flags &= ~FLUSH_EXIT;
+		cleanups = ump->um_softdep->sd_cleanups;
 		FREE_LOCK(ump);
 		wakeup(&ump->softdep_flags);
-		if (print_threads)
-			printf("Stop thread %s: searchfailed %d, did cleanups %d\n", td->td_name, searchfailed, ump->um_softdep->sd_cleanups);
+		if (print_threads) {
+			printf("Stop thread %s: searchfailed %d, "
+			    "did cleanups %d\n",
+			    td->td_name, searchfailed, cleanups);
+		}
 		atomic_subtract_int(&stat_flush_threads, 1);
 		kthread_exit();
 		panic("kthread_exit failed\n");



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