[PATCH] nvme-multipath: Reset bi_disk to ns head when failover

Christoph Hellwig hch at lst.de
Mon May 3 16:53:45 BST 2021


On Mon, May 03, 2021 at 02:57:41PM +0200, Daniel Wagner wrote:
> The path can be stale when we failover. If we don't reset the bdev to
> the ns head and the I/O finally completes in end_io() it will triggers
> a crash. By resetting the to ns head disk so that the submit path can
> map the request to an active path.
> 
> Signed-off-by: Daniel Wagner <dwagner at suse.de>
> ---
> 
> The patch is against nvme-5.13.

There is no bi_disk in nvme-5.13, but fortunately that slipped in only
in the subject.

> +	bdev = bdget_disk(ns->head->disk, 0);

Please just use ns->head->disk->part0 directly.  No need for the
reference and bdget_disk is about to go away.



More information about the Linux-nvme mailing list