[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20181211184553.GH6830@bombadil.infradead.org>
Date: Tue, 11 Dec 2018 10:45:53 -0800
From: Matthew Wilcox <willy@...radead.org>
To: Jens Axboe <axboe@...nel.dk>
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>
Subject: Re: [PATCH] aio: Convert ioctx_table to XArray
On Tue, Dec 11, 2018 at 11:41:55AM -0700, Jens Axboe wrote:
> On Wed, Nov 28, 2018 at 11:35 AM Matthew Wilcox <willy@...radead.org> wrote:
> >
> > 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.
I think we need the rcu read lock here to prevent ctx from being freed
under us by free_ioctx().
Powered by blists - more mailing lists