From 7a61c38c4d6ae3d5cbe6efa06885b1ca821a129c Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Tue, 21 Apr 2026 16:44:06 -0600 Subject: [PATCH 2/2] io_uring/poll: fix backport of io_poll_add() changes The 5.15/5.10 backport of 84230ad2d2af had a few issues, due to the older poll base. Notably return value handling __io_arm_poll_handler() and in return __io_poll_add() as well. Fix them up. Reported-by: Ben Hutchings Fixes: 349ef5d2e7bf ("io_uring/poll: correctly handle io_poll_add() return value on update") Signed-off-by: Jens Axboe --- io_uring/io_uring.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c index db5c9fbdec3b..07519e9a695c 100644 --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -6138,19 +6138,15 @@ static int __io_poll_add(struct io_kiocb *req, unsigned int issue_flags) if (!ret && ipt.error) req_set_fail(req); ret = ret ?: ipt.error; - if (ret > 0) { + if (ret) __io_req_complete(req, issue_flags, ret, 0); - return ret; - } - return 0; + return ret; } static int io_poll_add(struct io_kiocb *req, unsigned int issue_flags) { - int ret; - - ret = __io_poll_add(req, issue_flags); - return ret < 0 ? ret : 0; + __io_poll_add(req, issue_flags); + return 0; } static int io_poll_update(struct io_kiocb *req, unsigned int issue_flags) -- 2.53.0