]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-6.6/io_uring-kbuf-get-rid-of-bl-is_ready.patch
Linux 6.1.85
[thirdparty/kernel/stable-queue.git] / queue-6.6 / io_uring-kbuf-get-rid-of-bl-is_ready.patch
1 From 3b80cff5a4d117c53d38ce805823084eaeffbde6 Mon Sep 17 00:00:00 2001
2 From: Jens Axboe <axboe@kernel.dk>
3 Date: Thu, 14 Mar 2024 10:46:40 -0600
4 Subject: io_uring/kbuf: get rid of bl->is_ready
5
6 From: Jens Axboe <axboe@kernel.dk>
7
8 commit 3b80cff5a4d117c53d38ce805823084eaeffbde6 upstream.
9
10 Now that xarray is being exclusively used for the buffer_list lookup,
11 this check is no longer needed. Get rid of it and the is_ready member.
12
13 Cc: stable@vger.kernel.org # v6.4+
14 Signed-off-by: Jens Axboe <axboe@kernel.dk>
15 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
16 ---
17 io_uring/kbuf.c | 8 --------
18 io_uring/kbuf.h | 2 --
19 2 files changed, 10 deletions(-)
20
21 --- a/io_uring/kbuf.c
22 +++ b/io_uring/kbuf.c
23 @@ -59,7 +59,6 @@ static int io_buffer_add_list(struct io_
24 * always under the ->uring_lock, but the RCU lookup from mmap does.
25 */
26 bl->bgid = bgid;
27 - smp_store_release(&bl->is_ready, 1);
28 return xa_err(xa_store(&ctx->io_bl_xa, bgid, bl, GFP_KERNEL));
29 }
30
31 @@ -691,13 +690,6 @@ void *io_pbuf_get_address(struct io_ring
32
33 if (!bl || !bl->is_mmap)
34 return NULL;
35 - /*
36 - * Ensure the list is fully setup. Only strictly needed for RCU lookup
37 - * via mmap, and in that case only for the array indexed groups. For
38 - * the xarray lookups, it's either visible and ready, or not at all.
39 - */
40 - if (!smp_load_acquire(&bl->is_ready))
41 - return NULL;
42
43 return bl->buf_ring;
44 }
45 --- a/io_uring/kbuf.h
46 +++ b/io_uring/kbuf.h
47 @@ -29,8 +29,6 @@ struct io_buffer_list {
48 __u8 is_mapped;
49 /* ring mapped provided buffers, but mmap'ed by application */
50 __u8 is_mmap;
51 - /* bl is visible from an RCU point of view for lookup */
52 - __u8 is_ready;
53 };
54
55 struct io_buffer {