[PATCH RFC] nvme-multipath: don't retry adding head disk
Christoph Hellwig
hch at lst.de
Thu Jul 30 04:40:09 PDT 2026
On Wed, Jul 29, 2026 at 06:22:35PM +0000, John Garry wrote:
> From: John Garry <john.garry at linux.dev>
>
> If an attempt to add the head disk in nvme_mpath_set_live() ->
> device_add_disk() fails, then flag NVME_NSHEAD_DISK_LIVE is cleared and
> we bail out.
>
> However, we may later call nvme_mpath_set_live() -> device_add_disk() again
> for another NS or from ANA updates for the same NS. This is broken, as we
> should not retry adding the disk - it breaks the driver model.
>
> Add a flag NVME_NSHEAD_DISK_BROKEN to stop this happening.
>
> Signed-off-by: John Garry <john.g.garry at oracle.com>
> ---
> I'm not happy with this solution, as we have a DOA disk and it would be
> better to remove the NSes in this case. OTOH, this device_add_disk()
> failure is very unlikely to happen, so we should not add a complex
> solution to handle it.
Yeah. Broken is a bit weird of a name for something that would
either be a logic bug or a really messed up kernel, though.
I guess you arrive there by error injection?
More information about the Linux-nvme
mailing list