Re: [PATCH RFC] nvme-multipath: don't retry adding head disk
John Garry <[email protected]> Thu, 30 Jul 2026 14:04:41 +0100
| Newsgroups | org.infradead.lists.linux-nvme |
|---|---|
| Organization | Oracle Corporation |
| Message-ID | <[email protected]> |
On 30/07/2026 12:40, Christoph Hellwig wrote: > On Wed, Jul 29, 2026 at 06:22:35PM +0000, John Garry wrote: >> From: John Garry <[email protected]> >> >> 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 <[email protected]> >> --- >> 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. NVME_NSHEAD_DISK_FAILED or NVME_NSHEAD_DISK_FAILED_ADD > > I guess you arrive there by error injection? I just bodged an error in device_add_disk(). btw, sashiko notified me about this issue elsewhere.