[PATCH] nvme: Add sibling to list after full initialization

Daniel Wagner dwagner at suse.de
Mon Nov 15 01:10:48 PST 2021


Hi Sagi,

On Sun, Nov 14, 2021 at 12:56:55PM +0200, Sagi Grimberg wrote:
> > Adding the newly created namespace before the object is fully
> > initialized is opening a race with nvme_mpath_revalidate_paths() which
> > tries to access ns->disk. ns->disk can still be NULL when iterating
> > over the sibling list.
>
> But ns->disk is assigned before nvme_init_ns_head is even called.

ns->disk is NULL, but we are missing 5f432cceb3e9 ("nvme: use
blk_mq_alloc_disk") in our kernels. The commit moves the ns->disk
assignment in front of nvme_init_ns_head.

I didn't spot the code change when I forward ported the patch.

Sorry for the noise and thanks for the feedback!
Daniel



More information about the Linux-nvme mailing list