]> git.itanic.dy.fi Git - linux-stable/commitdiff
io_uring/kbuf: get rid of bl->is_ready
authorJens Axboe <axboe@kernel.dk>
Thu, 14 Mar 2024 16:46:40 +0000 (10:46 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Apr 2024 14:38:16 +0000 (16:38 +0200)
commit 3b80cff5a4d117c53d38ce805823084eaeffbde6 upstream.

Now that xarray is being exclusively used for the buffer_list lookup,
this check is no longer needed. Get rid of it and the is_ready member.

Cc: stable@vger.kernel.org # v6.4+
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
io_uring/kbuf.c
io_uring/kbuf.h

index d6346144cbb61b5d43ecbd7ed1a7f683f36d9628..d5efc7c275c2dae323117c5c95aaf7c1c82e3c97 100644 (file)
@@ -61,7 +61,6 @@ static int io_buffer_add_list(struct io_ring_ctx *ctx,
         * always under the ->uring_lock, but the RCU lookup from mmap does.
         */
        bl->bgid = bgid;
-       smp_store_release(&bl->is_ready, 1);
        return xa_err(xa_store(&ctx->io_bl_xa, bgid, bl, GFP_KERNEL));
 }
 
@@ -730,13 +729,6 @@ void *io_pbuf_get_address(struct io_ring_ctx *ctx, unsigned long bgid)
 
        if (!bl || !bl->is_mmap)
                return NULL;
-       /*
-        * Ensure the list is fully setup. Only strictly needed for RCU lookup
-        * via mmap, and in that case only for the array indexed groups. For
-        * the xarray lookups, it's either visible and ready, or not at all.
-        */
-       if (!smp_load_acquire(&bl->is_ready))
-               return NULL;
 
        return bl->buf_ring;
 }
index 53dfaa71a397cedd9b52923a3f0178873aaf9960..3722e44daf0b36e4853b6027ae5652443c76010a 100644 (file)
@@ -29,8 +29,6 @@ struct io_buffer_list {
        __u8 is_mapped;
        /* ring mapped provided buffers, but mmap'ed by application */
        __u8 is_mmap;
-       /* bl is visible from an RCU point of view for lookup */
-       __u8 is_ready;
 };
 
 struct io_buffer {