summaryrefslogtreecommitdiff
path: root/kernel/exit.c
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2026-09-30 11:58:30 +0100
committerMark Brown <broonie@kernel.org>2026-09-30 11:58:30 +0100
commit5eb3fdca6ca7667a73d52adfd047d94e8b8b105e (patch)
treec935b3fa5b47c9d70e0e66c7cc7830e74988b13f /kernel/exit.c
parentf60deca1c3741ab8fcf318a7bb82a3d026ea7c49 (diff)
parent84086827932b58e7645d93d970bbc566c4ee408b (diff)
downloadlinux-next-5eb3fdca6ca7667a73d52adfd047d94e8b8b105e.tar.gz
linux-next-5eb3fdca6ca7667a73d52adfd047d94e8b8b105e.zip
Merge branch 'vfs.all' of https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
# Conflicts: # fs/smb/server/smb2pdu.c # fs/smb/server/vfs.c # fs/smb/server/vfs.h
Diffstat (limited to 'kernel/exit.c')
-rw-r--r--kernel/exit.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/kernel/exit.c b/kernel/exit.c
index 282328d2b4cf..29e853a36602 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -17,6 +17,7 @@
#include <linux/module.h>
#include <linux/capability.h>
#include <linux/completion.h>
+#include <linux/wait_bit.h>
#include <linux/personality.h>
#include <linux/tty.h>
#include <linux/iocontext.h>
@@ -436,15 +437,14 @@ static void coredump_task_exit(struct task_struct *tsk,
self.task = tsk;
if (self.task->flags & PF_SIGNALED)
- self.next = xchg(&core_state->dumper.next, &self);
+ self.next = xchg(&core_state->tasks, &self);
else
self.task = NULL;
/*
* Implies mb(), the result of xchg() must be visible
- * to core_state->dumper.
+ * to the dumper.
*/
- if (atomic_dec_and_test(&core_state->nr_threads))
- complete(&core_state->startup);
+ atomic_dec_and_wake_up(&core_state->threads_remaining);
for (;;) {
set_current_state(TASK_IDLE|TASK_FREEZABLE);
@@ -892,7 +892,7 @@ static void synchronize_group_exit(struct task_struct *tsk, long code)
* Serialize with any possible pending coredump.
* We must hold siglock around checking core_state
* and setting PF_POSTCOREDUMP. The core-inducing thread
- * will increment ->nr_threads for each thread in the
+ * will increment ->threads_remaining for each thread in the
* group without PF_POSTCOREDUMP set.
*/
tsk->flags |= PF_POSTCOREDUMP;
@@ -978,10 +978,11 @@ void __noreturn do_exit(long code)
exit_sem(tsk);
exit_shm(tsk);
- exit_files(tsk);
- exit_fs(tsk);
+ /* Hang the tty up before the last close of it can clear the session. */
if (group_dead)
disassociate_ctty(1);
+ exit_files(tsk);
+ exit_fs(tsk);
exit_nsproxy_namespaces(tsk);
exit_task_work(tsk);
exit_thread(tsk);