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

From: Christoph Hellwig
Date: Mon May 03 2021 - 11:53:51 EST


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@xxxxxxx>
> ---
>
> 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.