Commit 10442994 authored by Jens Axboe's avatar Jens Axboe

kernel: don't call do_exit() for PF_IO_WORKER threads

Right now we're never calling get_signal() from PF_IO_WORKER threads, but
in preparation for doing so, don't handle a fatal signal for them. The
workers have state they need to cleanup when exiting, so just return
instead of calling do_exit() on their behalf. The threads themselves will
detect a fatal signal and do proper shutdown.
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 90b87490
...@@ -2771,6 +2771,14 @@ bool get_signal(struct ksignal *ksig) ...@@ -2771,6 +2771,14 @@ bool get_signal(struct ksignal *ksig)
do_coredump(&ksig->info); do_coredump(&ksig->info);
} }
/*
* PF_IO_WORKER threads will catch and exit on fatal signals
* themselves. They have cleanup that must be performed, so
* we cannot call do_exit() on their behalf.
*/
if (current->flags & PF_IO_WORKER)
goto out;
/* /*
* Death signals, no core dump. * Death signals, no core dump.
*/ */
...@@ -2778,7 +2786,7 @@ bool get_signal(struct ksignal *ksig) ...@@ -2778,7 +2786,7 @@ bool get_signal(struct ksignal *ksig)
/* NOTREACHED */ /* NOTREACHED */
} }
spin_unlock_irq(&sighand->siglock); spin_unlock_irq(&sighand->siglock);
out:
ksig->sig = signr; ksig->sig = signr;
if (!(ksig->ka.sa.sa_flags & SA_EXPOSE_TAGBITS)) if (!(ksig->ka.sa.sa_flags & SA_EXPOSE_TAGBITS))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment