summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Begunkov <asml.silence@gmail.com>2023-09-12 15:02:50 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-09-19 12:20:24 +0200
commitf271e3d64b8b5691ebf3f16768a94373ceb7ec87 (patch)
treee7b28907ef2dd076b10625114f594420603387f3
parent9faa6d0677ec0a5b459b94c1b1f45117974e3b10 (diff)
downloadlinux-stable-f271e3d64b8b5691ebf3f16768a94373ceb7ec87.tar.gz
linux-stable-f271e3d64b8b5691ebf3f16768a94373ceb7ec87.tar.bz2
linux-stable-f271e3d64b8b5691ebf3f16768a94373ceb7ec87.zip
io_uring: break iopolling on signal
[ upstream commit dc314886cb3d0e4ab2858003e8de2917f8a3ccbd ] Don't keep spinning iopoll with a signal set. It'll eventually return back, e.g. by virtue of need_resched(), but it's not a nice user experience. Cc: stable@vger.kernel.org Fixes: def596e9557c9 ("io_uring: support for IO polling") Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Link: https://lore.kernel.org/r/eeba551e82cad12af30c3220125eb6cb244cc94c.1691594339.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--io_uring/io_uring.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
index e5bef0a8e5ea..800b5cc385af 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -2665,6 +2665,11 @@ static int io_iopoll_check(struct io_ring_ctx *ctx, long min)
break;
}
ret = io_do_iopoll(ctx, &nr_events, min);
+
+ if (task_sigpending(current)) {
+ ret = -EINTR;
+ goto out;
+ }
} while (!ret && nr_events < min && !need_resched());
out:
mutex_unlock(&ctx->uring_lock);