Re: [PATCH] nvme: add missing SRCU grace period in error path

Keith Busch <[email protected]>
Newsgroups org.kernel.vger.stable,org.infradead.lists.linux-nvme,org.kernel.vger.linux-kernel
Message-ID <aoznqfUpR3t-GpgE@kbusch-mbp>
On Sat, Aug 15, 2026 at 12:14:27AM +0000, Tristan Madani wrote:
> From: Tristan Madani <[email protected]>
> 
> nvme_alloc_ns() error path at out_unlink_ns removes ns from the
> namespace head siblings list with list_del_rcu(&ns->siblings) but
> does not wait for SRCU readers before freeing the namespace struct.
> Multipath code iterates the head->list under srcu_read_lock() in
> nvme_find_path() and nvme_mpath_revalidate_paths(), so a concurrent
> reader can still hold a reference to ns when kfree(ns) runs.
> 
> The normal removal path in nvme_ns_remove() correctly calls
> synchronize_srcu(&ns->head->srcu) after list_del_rcu() to wait for
> in-progress readers. Add the same grace period in the error path.

Thanks, applied to nvme-7.3.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.