Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Shin'ichiro Kawasaki" <shinichiro.kawasaki@wdc.com>,
	linux-rdma@vger.kernel.org, linux-nvme@lists.infradead.org
Subject: Re: [PATCH RFC 2/2] nvmet-rdma: use a separate lockdep class for the listening cm_id
Date: Sun, 08 Nov 2026 12:16:38 +0000	[thread overview]
Message-ID: <sashiko-outbox-203707@kernel.org> (raw)
In-Reply-To: <20261108120154.148824-3-shinichiro.kawasaki@wdc.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] nvmet-rdma: wildcard listener child cm_ids keep default lockdep
  class
--

commit a129fce174ee6d77cacc5458875c55e53aa41b7e
Author: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>

nvmet-rdma: use a separate lockdep class for the listening cm_id

This commit calls rdma_reclassify_id_for_listen() on the port's listening
cm_id in nvmet_rdma_enable_port() to give its handler_mutex a separate
lockdep class from connected queue cm_ids.

Link: https://lore.kernel.org/linux-nvme/at36um4zrsfOr3kh@shinmob/

> diff --git a/drivers/nvme/target/rdma.c b/drivers/nvme/target/rdma.c
> index b9e39d1657d29..94f6d8edb517f 100644
> --- a/drivers/nvme/target/rdma.c
> +++ b/drivers/nvme/target/rdma.c
> @@ -1914,6 +1914,8 @@ static int nvmet_rdma_enable_port(struct nvmet_rdma_port *port)
>  		return PTR_ERR(cm_id);
>  	}
>  
> +	rdma_reclassify_id_for_listen(cm_id);
> +
>  	/*
>  	 * Allow both IPv4 and IPv6 sockets to bind a single port
>  	 * at the same time.

[Severity: Low]
Does this still leave the per-device child listening cm_ids in the default
handler_mutex lockdep class when port->addr is a wildcard address?

For a wildcard address, rdma_bind_addr() leaves id_priv->cma_dev NULL, so
rdma_listen() calls cma_listen_on_all() -> cma_listen_on_dev(), which
creates a per-device child dev_id_priv via __rdma_create_id() without
reclassifying its handler_mutex:

drivers/infiniband/core/cma.c:cma_listen_on_dev() {
	...
	dev_id_priv =
		__rdma_create_id(net, cma_listen_handler, id_priv,
				 id_priv->id.ps, id_priv->id.qp_type, id_priv);
	...
}

When nvmet_rdma_disable_port() later calls rdma_destroy_id(cm_id) under
nvmet_config_sem, _cma_cancel_listens() calls
rdma_destroy_id(&dev_id_priv->id) and takes dev_id_priv->handler_mutex,
triggering the same false-positive lockdep warning.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261108120154.148824-1-shinichiro.kawasaki@wdc.com?part=2

  reply	other threads:[~2026-11-08 12:16 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-08 12:01 [PATCH RFC 0/2] RDMA/cma, nvmet-rdma: fix a lockdep WARN Shin'ichiro Kawasaki
2026-11-08 12:01 ` [PATCH RFC 1/2] RDMA/cma: Add rdma_reclassify_id_for_listen() Shin'ichiro Kawasaki
2026-11-08 12:16   ` sashiko-bot
2026-11-08 12:01 ` [PATCH RFC 2/2] nvmet-rdma: use a separate lockdep class for the listening cm_id Shin'ichiro Kawasaki
2026-11-08 12:16   ` sashiko-bot [this message]
2026-11-10  0:32   ` Jason Gunthorpe
2026-11-11  5:01     ` Shin'ichiro Kawasaki
2026-11-11 15:37       ` Jason Gunthorpe
2026-11-12  2:13         ` Shin'ichiro Kawasaki

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=sashiko-outbox-203707@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=shinichiro.kawasaki@wdc.com \
    /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