All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hannes Reinecke <hare@suse.de>
To: John Garry <john.g.garry@oracle.com>,
	hch@lst.de, kbusch@kernel.org, sagi@grimberg.me, axboe@fb.com
Cc: linux-nvme@lists.infradead.org
Subject: Re: [PATCH] nvme: don't reference NS after unlocking in nvme_ns_head_ctrl_ioctl()
Date: Tue, 14 Jul 2026 15:12:24 +0200	[thread overview]
Message-ID: <f47bdb78-e19c-440a-bbcb-71cb4cdfb5f1@suse.de> (raw)
In-Reply-To: <20260706125402.615277-1-john.g.garry@oracle.com>

On 7/6/26 2:54 PM, John Garry wrote:
> In nvme_ns_head_ctrl_ioctl(), once we drop the SRCU read lock we should
> not reference the NS to lookup the controller, so use the available
> controller pointer directly.
> 
> Signed-off-by: John Garry <john.g.garry@oracle.com>
> 
> diff --git a/drivers/nvme/host/ioctl.c b/drivers/nvme/host/ioctl.c
> index 664216eece4a6..d5a8f375953bc 100644
> --- a/drivers/nvme/host/ioctl.c
> +++ b/drivers/nvme/host/ioctl.c
> @@ -699,7 +699,7 @@ static int nvme_ns_head_ctrl_ioctl(struct nvme_ns *ns, unsigned int cmd,
>   
>   	nvme_get_ctrl(ns->ctrl);
>   	srcu_read_unlock(&head->srcu, srcu_idx);
> -	ret = nvme_ctrl_ioctl(ns->ctrl, cmd, argp, open_for_write);
> +	ret = nvme_ctrl_ioctl(ctrl, cmd, argp, open_for_write);
>   
>   	nvme_put_ctrl(ctrl);
>   	return ret;

Reviewed-by: Hannes Reinecke <hare@kernel.org>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke                  Kernel Storage Architect
hare@suse.de                                +49 911 74053 688
SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg
HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich


      parent reply	other threads:[~2026-07-14 13:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-06 12:54 [PATCH] nvme: don't reference NS after unlocking in nvme_ns_head_ctrl_ioctl() John Garry
2026-07-08  9:17 ` Christoph Hellwig
2026-07-08 19:14 ` Keith Busch
2026-07-14 13:12 ` Hannes Reinecke [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=f47bdb78-e19c-440a-bbcb-71cb4cdfb5f1@suse.de \
    --to=hare@suse.de \
    --cc=axboe@fb.com \
    --cc=hch@lst.de \
    --cc=john.g.garry@oracle.com \
    --cc=kbusch@kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sagi@grimberg.me \
    /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.