Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Keith Busch <kbusch@meta.com>
Cc: linux-nvme@lists.infradead.org, shinichiro.kawasaki@wdc.com,
	hch@lst.de, sagi@grimberg.me, axboe@kernel.dk,
	Keith Busch <kbusch@kernel.org>
Subject: Re: [PATCHv2] nvme: use srcu for iterating namespace list
Date: Fri, 24 May 2024 09:42:19 +0200	[thread overview]
Message-ID: <20240524074219.GB17251@lst.de> (raw)
In-Reply-To: <20240523172050.4080218-1-kbusch@meta.com>

> -	ns = list_first_entry(&ctrl->namespaces, struct nvme_ns, list);
> -	if (ns != list_last_entry(&ctrl->namespaces, struct nvme_ns, list)) {
> +	ns = list_first_or_null_rcu(&ctrl->namespaces, struct nvme_ns, list);
> +	if (!ns) {
>  		dev_warn(ctrl->device,
>  			"NVME_IOCTL_IO_CMD not supported when multiple namespaces present!\n");
>  		ret = -EINVAL;
> @@ -808,14 +808,14 @@ static int nvme_dev_user_cmd(struct nvme_ctrl *ctrl, void __user *argp,
>  	dev_warn(ctrl->device,
>  		"using deprecated NVME_IOCTL_IO_CMD ioctl on the char device!\n");
>  	kref_get(&ns->kref);

This still needs to use a kref_geT_unless_zero as mentioned in the last
round.



  parent reply	other threads:[~2024-05-24  7:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-23 17:20 [PATCHv2] nvme: use srcu for iterating namespace list Keith Busch
2024-05-24  4:41 ` Shinichiro Kawasaki
2024-05-24 15:29   ` Sagi Grimberg
2024-05-27  0:33     ` Shinichiro Kawasaki
2024-05-24  7:42 ` Christoph Hellwig [this message]
2024-05-24 15:28 ` Sagi Grimberg

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=20240524074219.GB17251@lst.de \
    --to=hch@lst.de \
    --cc=axboe@kernel.dk \
    --cc=kbusch@kernel.org \
    --cc=kbusch@meta.com \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sagi@grimberg.me \
    --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