All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "John Garry" <john.g.garry@oracle.com>
Cc: linux-scsi@vger.kernel.org
Subject: Re: [PATCH v3 08/10] nvme-multipath: add nvme_{add,delete}_ns()
Date: Fri, 03 Jul 2026 11:24:13 +0000	[thread overview]
Message-ID: <20260703112413.9EA6C1F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260703103204.3724406-9-john.g.garry@oracle.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Low] The function `nvme_add_ns()` unconditionally accesses `ns->ctrl->nr_active`, which is conditionally compiled, causing a build failure when `CONFIG_NVME_MULTIPATH` is disabled.
- [Low] The patch introduces calls to undeclared functions (`mpath_add_device`, `mpath_delete_device`), causing a hard compilation failure.
--

commit 6769aa1dce3bd34edd5c71bc4aa5c9950e9c148a
Author: John Garry <john.g.garry@oracle.com>

nvme-multipath: add nvme_{add,delete}_ns()

This commit adds wrapper functions to call into the mpath_add_device and
mpath_delete_device APIs. The per-NS gendisk pointer is utilized as the
mpath_device disk pointer for libmultipath references.

> diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h
> --- a/drivers/nvme/host/nvme.h
> +++ b/drivers/nvme/host/nvme.h

[ ... ]

> @@ -1041,6 +1041,18 @@ extern const struct block_device_operations nvme_bdev_ops;
>  
>  void nvme_delete_ctrl_sync(struct nvme_ctrl *ctrl);
>  struct nvme_ns *nvme_find_path(struct nvme_ns_head *head);
> +
> +static inline void nvme_add_ns(struct nvme_ns *ns)
> +{
> +	mpath_add_device(&ns->mpath_device, &ns->head->mpath_head,
> +		ns->disk, ns->ctrl->numa_node, &ns->ctrl->nr_active);

[Severity: Low]
Will this cause a build failure when CONFIG_NVME_MULTIPATH is disabled?
Looking at struct nvme_ctrl, the nr_active field is conditionally compiled,
but nvme_add_ns accesses it unconditionally.

Also, are mpath_add_device and mpath_delete_device declared in a header
that is included here? It appears these functions might be undeclared,
which would result in implicit declaration errors during the build.

> +}
> +
> +static inline bool nvme_delete_ns(struct nvme_ns *ns)
> +{
> +	return mpath_delete_device(&ns->mpath_device);
> +}

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260703103204.3724406-1-john.g.garry@oracle.com?part=8

  reply	other threads:[~2026-07-03 11:24 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-03 10:31 [PATCH v3 00/10] nvme: switch to libmultipath John Garry
2026-07-03 10:31 ` [PATCH v3 01/10] nvme-multipath: add initial support for using libmultipath John Garry
2026-07-03 10:44   ` sashiko-bot
2026-07-03 10:31 ` [PATCH v3 02/10] nvme-multipath: add nvme_mpath_available_path() John Garry
2026-07-03 10:31 ` [PATCH v3 03/10] nvme-multipath: add nvme_mpath_{add, remove}_cdev() John Garry
2026-07-03 10:31 ` [PATCH v3 04/10] nvme-multipath: add nvme_mpath_is_{disabled, optimised} John Garry
2026-07-03 11:06   ` sashiko-bot
2026-07-03 10:31 ` [PATCH v3 05/10] nvme-multipath: add nvme_mpath_cdev_ioctl() John Garry
2026-07-03 11:11   ` sashiko-bot
2026-07-03 10:32 ` [PATCH v3 06/10] nvme-multipath: add uring_cmd support John Garry
2026-07-03 11:42   ` sashiko-bot
2026-07-03 10:32 ` [PATCH v3 07/10] nvme-multipath: add nvme_mpath_synchronize() John Garry
2026-07-03 11:24   ` sashiko-bot
2026-07-03 14:50     ` John Garry
2026-07-03 10:32 ` [PATCH v3 08/10] nvme-multipath: add nvme_{add,delete}_ns() John Garry
2026-07-03 11:24   ` sashiko-bot [this message]
2026-07-03 10:32 ` [PATCH v3 09/10] nvme-multipath: add nvme_mpath_head_queue_if_no_path() John Garry
2026-07-03 11:33   ` sashiko-bot
2026-07-03 10:32 ` [PATCH v3 10/10] nvme-multipath: switch to use libmultipath John Garry
2026-07-03 11:42   ` sashiko-bot

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=20260703112413.9EA6C1F00A3A@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=john.g.garry@oracle.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.