Skip to content

Commit fc7222c

Browse files
committed
io_uring/msg_ring: check file type before putting
If we're invoked with a fixed file, follow the normal rules of not calling io_fput_file(). Fixed files are permanently registered to the ring, and do not need putting separately. Cc: stable@vger.kernel.org Fixes: aa184e8 ("io_uring: don't attempt to IOPOLL for MSG_RING requests") Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 62bb064 commit fc7222c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

io_uring/msg_ring.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,8 @@ int io_msg_ring(struct io_kiocb *req, unsigned int issue_flags)
165165
req_set_fail(req);
166166
io_req_set_res(req, ret, 0);
167167
/* put file to avoid an attempt to IOPOLL the req */
168-
io_put_file(req->file);
168+
if (!(req->flags & REQ_F_FIXED_FILE))
169+
io_put_file(req->file);
169170
req->file = NULL;
170171
return IOU_OK;
171172
}

0 commit comments

Comments
 (0)