[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <09e3d156-66fc-ca17-efac-63f080a27a1d@kernel.dk>
Date: Tue, 11 Dec 2018 11:41:55 -0700
From: Jens Axboe <axboe@...nel.dk>
To: Matthew Wilcox <willy@...radead.org>
Cc: Al Viro <viro@...iv.linux.org.uk>,
Benjamin LaHaise <bcrl@...ck.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Kees Cook <keescook@...omium.org>,
fsdevel <linux-fsdevel@...r.kernel.org>, linux-aio@...ck.org,
linux-mm <linux-mm@...ck.org>,
linux-kernel <linux-kernel@...r.kernel.org>,
Dan Carpenter <dan.carpenter@...cle.com>,
Matthew Wilcox <willy@...radead.org>
Subject: Re: [PATCH] aio: Convert ioctx_table to XArray
On Wed, Nov 28, 2018 at 11:35 AM Matthew Wilcox <willy@...radead.org> wrote:
> @@ -1026,24 +979,17 @@ static struct kioctx *lookup_ioctx(unsigned long ctx_id)
> struct aio_ring __user *ring = (void __user *)ctx_id;
> struct mm_struct *mm = current->mm;
> struct kioctx *ctx, *ret = NULL;
> - struct kioctx_table *table;
> unsigned id;
>
> if (get_user(id, &ring->id))
> return NULL;
>
> rcu_read_lock();
> - table = rcu_dereference(mm->ioctx_table);
> -
> - if (!table || id >= table->nr)
> - goto out;
> -
> - ctx = rcu_dereference(table->table[id]);
> + ctx = xa_load(&mm->ioctx, id);
> if (ctx && ctx->user_id == ctx_id) {
> if (percpu_ref_tryget_live(&ctx->users))
> ret = ctx;
> }
Question on this part - do we need that RCU read lock around this now? I
don't think we do.
--
Jens Axboe
Powered by blists - more mailing lists