From: Andrew Morton <akpm@linux-foundation.org>
To: Nickolai Zeldovich <nickolai@csail.mit.edu>
Cc: Matthew Wilcox <willy@infradead.org>,
linux-fsdevel@vger.kernel.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org, Baoli Zhang <baoli.zhang@intel.com>
Subject: Re: [PATCH v2] xarray: initialise the offset of a new root node
Date: Sat, 21 Nov 2026 14:17:43 -0800 [thread overview]
Message-ID: <20261121141743.6f1095f5355fcdb4519ed979@linux-foundation.org> (raw)
In-Reply-To: <20261024014344.830116-1-nickolai@csail.mit.edu>
On Fri, 23 Oct 2026 21:43:44 -0400 Nickolai Zeldovich <nickolai@csail.mit.edu> wrote:
> An RCU walker such as xas_find() that climbs out of the root while
> xas_expand() adds a level above it can resume in the new root at the
> wrong slot and return an entry with the wrong index.
>
> xas_alloc() sets node->offset only for a node with a parent, so a new
> root keeps the offset its slab object had before. xas_expand() stores
> 0 to the old root's offset just before linking it below the new root,
> and a walker can load the stale offset before that store and the new
> parent pointer after it.
>
> Set the offset of a node allocated without a parent to 0. The store in
> xas_expand() then writes the value the old root already has, so remove
> it.
Thanks.
I turned this into a 2-patch series. The first adds the test to
test_xarray and the second fixes the lib/xarray.c issue.
Which is arguably the wrong order - I have just created history's least
important bisection hole. But it's convenient for before-and-after
testing. I did that before-and-after testing and it all checks out.
I'll send this 2-patch series out for review.
prev parent reply other threads:[~2026-11-21 22:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-12 18:11 [PATCH v1] " Nickolai Zeldovich
2026-10-23 20:29 ` Matthew Wilcox
2026-10-24 1:43 ` [PATCH v2] " Nickolai Zeldovich
2026-11-21 22:17 ` Andrew Morton [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261121141743.6f1095f5355fcdb4519ed979@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=baoli.zhang@intel.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=nickolai@csail.mit.edu \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®