linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Kanchan Joshi <joshi.k@samsung.com>
Cc: Christoph Hellwig <hch@lst.de>,
	kbusch@kernel.org, harimishal1@gmail.com, sagi@grimberg.me,
	linux-nvme@lists.infradead.org, gregkh@linuxfoundation.org
Subject: Re: [PATCH] nvme: fix racy access to FDP placement id array
Date: Mon, 17 Aug 2026 11:30:16 +0200	[thread overview]
Message-ID: <20260817093016.GA27776@lst.de> (raw)
In-Reply-To: <e8dff6d2-8e2c-4ccf-b8c6-671a1b9e7f09@samsung.com>

On Mon, Aug 17, 2026 at 02:52:42PM +0530, Kanchan Joshi wrote:
> On 8/17/2026 1:53 PM, Christoph Hellwig wrote:
> >> +	if (ctrl->ctratt & NVME_CTRL_ATTR_FDPS) {
> >> +		ns->head = head;
> >> +		ret = nvme_query_fdp_info(ns, info);
> >> +		if (ret < 0)
> >> +			goto out_clear_ns_head;
> >> +	}
> > The conditional assignment of ns->head here is weird.  Just pass it
> > explicitly to nvme_query_fdp_info so that you don't have this issue.
> 
> ns->head is required even beyond nvme_query_fdp_info().
> 
> nvme_query_fdp_info(..)
> -> nvme_submit_sync_cmd(ns->queue, &c, ruhs, size);
>   -> __nvme_submit_sync_cmd(...);
>    -> nvme_init_request();
> 
> Which is going to touch ns->head here:
>           if (req->q->queuedata) {
>                   struct nvme_ns *ns = req->q->disk->private_data;
> 
>                   logging_enabled = ns->head->passthru_err_log_enabled;
> 	}

Then we'll need to assign it earlier unconditionally instead in a prep
patch.


      reply	other threads:[~2026-08-17  9:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20260817071233epcas5p19cd2497118e33c212af714ad84b06ac8@epcas5p1.samsung.com>
2026-08-17  7:11 ` [PATCH] nvme: fix racy access to FDP placement id array Kanchan Joshi
2026-08-17  8:23   ` Christoph Hellwig
2026-08-17  9:22     ` Kanchan Joshi
2026-08-17  9:30       ` Christoph Hellwig [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=20260817093016.GA27776@lst.de \
    --to=hch@lst.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=harimishal1@gmail.com \
    --cc=joshi.k@samsung.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).