public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
From: Nilay Shroff <nilay@linux.ibm.com>
To: John Garry <john.g.garry@oracle.com>,
	hch@lst.de, kbusch@kernel.org, sagi@grimberg.me, axboe@fb.com,
	martin.petersen@oracle.com,
	james.bottomley@hansenpartnership.com, hare@suse.com
Cc: jmeneghi@redhat.com, linux-nvme@lists.infradead.org,
	linux-scsi@vger.kernel.org, michael.christie@oracle.com,
	snitzer@kernel.org, bmarzins@redhat.com,
	dm-devel@lists.linux.dev, linux-block@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 19/19] nvme-multipath: switch to use libmultipath
Date: Mon, 2 Mar 2026 18:27:11 +0530	[thread overview]
Message-ID: <bfc2bfa4-a28d-47dc-9362-b9ff6680cfab@linux.ibm.com> (raw)
In-Reply-To: <20260225154007.1033735-20-john.g.garry@oracle.com>

On 2/25/26 9:10 PM, John Garry wrote:
>   void nvme_mpath_clear_ctrl_paths(struct nvme_ctrl *ctrl)
> @@ -277,30 +279,35 @@ void nvme_mpath_clear_ctrl_paths(struct nvme_ctrl *ctrl)
>   	srcu_idx = srcu_read_lock(&ctrl->srcu);
>   	list_for_each_entry_srcu(ns, &ctrl->namespaces, list,
>   				 srcu_read_lock_held(&ctrl->srcu)) {
> +		struct nvme_ns_head *head = ns->head;
> +		struct mpath_disk *mpath_disk = head->mpath_disk;
> +
> +		if (!mpath_disk)
> +			continue;
> +
>   		nvme_mpath_clear_current_path(ns);
> -		kblockd_schedule_work(&ns->head->requeue_work);
> +		kblockd_schedule_work(&mpath_disk->mpath_head->requeue_work);
>   	}
>   	srcu_read_unlock(&ctrl->srcu, srcu_idx);
>   }
>   
> +static void nvme_mpath_revalidate_paths_cb(struct mpath_device *mpath_device,
> +					sector_t capacity)
> +{
> +	struct nvme_ns *ns = nvme_mpath_to_ns(mpath_device);
> +
> +	if (capacity != get_capacity(ns->disk))
> +		clear_bit(NVME_NS_READY, &ns->flags);
> +}
> +

I don't quite understand the intent of the above function.
Here I see that we compare mpath_disk capacity with per-path
disk. Do we really have sectors allocated for mpath_disk?

Overall, IMO abstracting out common multipath function into
a separate library is a good move. But then I just want to
understand layering here with libmultipath. Does it sit above
the driver or below? I see in some places we have back and forth
callbacks from driver to libmultipath and then back to the
driver, for instance:
nvme_mpath_add_disk          => driver
  -> mpath_device_set_live    => libmultipath
   -> mpath_head_add_cdev     => libmultipath
     -> nvme_mpath_add_cdev   => driver

Does this intentional? Or am I missing overall picture...

Thanks,
--Nilay


  reply	other threads:[~2026-03-02 12:57 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-25 15:39 [PATCH 00/19] nvme: switch to libmultipath John Garry
2026-02-25 15:39 ` [PATCH 01/19] nvme-multipath: pass NS head to nvme_mpath_revalidate_paths() John Garry
2026-02-25 15:39 ` [PATCH 02/19] nvme: introduce a namespace count in the ns head structure John Garry
2026-03-02 12:46   ` Nilay Shroff
2026-03-02 15:57     ` John Garry
2026-02-25 15:39 ` [PATCH 03/19] nvme-multipath: add nvme_is_mpath_request() John Garry
2026-02-25 15:39 ` [PATCH 04/19] nvme-multipath: add initial support for using libmultipath John Garry
2026-02-25 15:39 ` [PATCH 05/19] nvme-multipath: add nvme_mpath_available_path() John Garry
2026-02-25 15:39 ` [PATCH 06/19] nvme-multipath: add nvme_mpath_{add, remove}_cdev() John Garry
2026-02-25 15:39 ` [PATCH 07/19] nvme-multipath: add nvme_mpath_is_{disabled, optimised} John Garry
2026-02-25 15:39 ` [PATCH 08/19] nvme-multipath: add nvme_mpath_get_access_state() John Garry
2026-02-25 15:39 ` [PATCH 09/19] nvme-multipath: add nvme_mpath_{bdev, cdev}_ioctl() John Garry
2026-02-25 15:39 ` [PATCH 10/19] nvme-multipath: add uring_cmd support John Garry
2026-02-25 15:39 ` [PATCH 11/19] nvme-multipath: add nvme_mpath_get_iopolicy() John Garry
2026-02-25 15:40 ` [PATCH 12/19] nvme-multipath: add PR support for libmultipath John Garry
2026-02-25 15:40 ` [PATCH 13/19] nvme-multipath: add nvme_mpath_report_zones() John Garry
2026-02-25 15:40 ` [PATCH 14/19] nvme-multipath: add nvme_mpath_get_unique_id() John Garry
2026-02-25 15:40 ` [PATCH 15/19] nvme-multipath: add nvme_mpath_synchronize() John Garry
2026-02-25 15:40 ` [PATCH 16/19] nvme-multipath: add nvme_mpath_{add,delete}_ns() John Garry
2026-03-02 12:48   ` Nilay Shroff
2026-03-02 15:59     ` John Garry
2026-02-25 15:40 ` [PATCH 17/19] nvme-multipath: add nvme_mpath_head_queue_if_no_path() John Garry
2026-02-25 15:40 ` [PATCH 18/19] nvme-multipath: set mpath_head_template.device_groups John Garry
2026-02-25 15:40 ` [PATCH 19/19] nvme-multipath: switch to use libmultipath John Garry
2026-03-02 12:57   ` Nilay Shroff [this message]
2026-03-02 16:13     ` John Garry
2026-03-02 14:12 ` [PATCH 00/19] nvme: switch to libmultipath Christoph Hellwig
2026-03-02 14:58   ` John Garry

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bfc2bfa4-a28d-47dc-9362-b9ff6680cfab@linux.ibm.com \
    --to=nilay@linux.ibm.com \
    --cc=axboe@fb.com \
    --cc=bmarzins@redhat.com \
    --cc=dm-devel@lists.linux.dev \
    --cc=hare@suse.com \
    --cc=hch@lst.de \
    --cc=james.bottomley@hansenpartnership.com \
    --cc=jmeneghi@redhat.com \
    --cc=john.g.garry@oracle.com \
    --cc=kbusch@kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=michael.christie@oracle.com \
    --cc=sagi@grimberg.me \
    --cc=snitzer@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox