From: Jens Axboe Date: Tue, 17 Mar 2026 20:10:19 +0000 (-0600) Subject: io_uring/poll: cache req->apoll_events X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=74dbc0bab57b7e5b4adbc93ce9179e0f36079e4c;p=thirdparty%2Fkernel%2Flinux.git io_uring/poll: cache req->apoll_events Avoid a potential reload of ->apoll_events post vfs_poll() by caching it in a local variable. Signed-off-by: Jens Axboe --- diff --git a/io_uring/poll.c b/io_uring/poll.c index b671b84657d9d..4175e63b9edf5 100644 --- a/io_uring/poll.c +++ b/io_uring/poll.c @@ -276,8 +276,10 @@ static int io_poll_check_events(struct io_kiocb *req, io_tw_token_t tw) /* the mask was stashed in __io_poll_execute */ if (!req->cqe.res) { - struct poll_table_struct pt = { ._key = req->apoll_events }; - req->cqe.res = vfs_poll(req->file, &pt) & req->apoll_events; + __poll_t events = req->apoll_events; + struct poll_table_struct pt = { ._key = events }; + + req->cqe.res = vfs_poll(req->file, &pt) & events; /* * We got woken with a mask, but someone else got to * it first. The above vfs_poll() doesn't add us back @@ -286,7 +288,7 @@ static int io_poll_check_events(struct io_kiocb *req, io_tw_token_t tw) */ if (unlikely(!req->cqe.res)) { /* Multishot armed need not reissue */ - if (!(req->apoll_events & EPOLLONESHOT)) + if (!(events & EPOLLONESHOT)) continue; return IOU_POLL_REISSUE; }