mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Keith Busch <kbusch@kernel.org>
To: Rongzheng Wang <testwrzwrz@gmail.com>
Cc: Christoph Hellwig <hch@lst.de>, Sagi Grimberg <sagi@grimberg.me>,
	Chaitanya Kulkarni <kch@nvidia.com>,
	linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] nvmet: use the enabled transport when disabling a port
Date: Mon, 26 Oct 2026 09:58:42 -0600	[thread overview]
Message-ID: <at94snlz2OrINQcC@kbusch-mbp> (raw)
In-Reply-To: <20261023191851.5316-1-testwrzwrz@gmail.com>

On Sat, Oct 24, 2026 at 03:18:51AM +0800, Rongzheng Wang wrote:
> nvmet_disable_port() looks up the transport from the current
> disc_addr.trtype, while nvmet_enable_port() records the transport in
> port->tr_ops.  If trtype is changed while a port is being enabled, the
> port can be removed through a different transport, passing the private
> data of the original transport to the wrong ->remove_port().
> 
> The same mismatch is reachable with loop and RDMA: loop add_port()
> leaves port->priv NULL, and RDMA remove_port() dereferences it.
> 
> Use port->tr_ops for removal and serialize trtype changes with
> nvmet_config_sem in nvmet_addr_trtype_store(), so the transport that
> added the port is also the one that removes it.

Thanks, applied to nvme-7.4.

      reply	other threads:[~2026-10-26 15:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-23 19:18 Rongzheng Wang
2026-10-26 15:58 ` Keith Busch [this message]

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=at94snlz2OrINQcC@kbusch-mbp \
    --to=kbusch@kernel.org \
    --cc=hch@lst.de \
    --cc=kch@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sagi@grimberg.me \
    --cc=testwrzwrz@gmail.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

all inboxes | Powered by JetHome®