git: a326a8f616e9 - stable/13 - softdep_flush(): do not access ump after we acked FLUSH_EXIT and unlocked SU lock
Konstantin Belousov
kib at FreeBSD.org
Sat Aug 14 10:22:27 UTC 2021
The branch stable/13 has been updated by kib:
URL: https://cgit.FreeBSD.org/src/commit/?id=a326a8f616e9fc0b7ec4024e555261485fc1b1e1
commit a326a8f616e9fc0b7ec4024e555261485fc1b1e1
Author: Konstantin Belousov <kib at FreeBSD.org>
AuthorDate: 2021-02-28 22:45:04 +0000
Commit: Konstantin Belousov <kib at 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");
More information about the dev-commits-src-branches
mailing list