diff options
author | Jens Axboe <axboe@kernel.dk> | 2021-03-26 17:57:10 +0300 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2021-03-27 01:10:14 +0300 |
commit | 10442994ba195efef6fdcc0c3699e4633cb5161b (patch) | |
tree | 9a500ecc3cad53fdd20db9fc3b3c0855896dbd96 /kernel | |
parent | 90b8749022bbdd0c94a13182a78f4903b98fd0d7 (diff) | |
download | linux-10442994ba195efef6fdcc0c3699e4633cb5161b.tar.xz |
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: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/signal.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/kernel/signal.c b/kernel/signal.c index f2a1b898da29..d22177d37b21 100644 --- a/kernel/signal.c +++ b/kernel/signal.c @@ -2772,13 +2772,21 @@ relock: } /* + * 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. */ do_group_exit(ksig->info.si_signo); /* NOTREACHED */ } spin_unlock_irq(&sighand->siglock); - +out: ksig->sig = signr; if (!(ksig->ka.sa.sa_flags & SA_EXPOSE_TAGBITS)) |