All of lore.kernel.org
 help / color / mirror / Atom feed
From: Keith Busch <kbusch@kernel.org>
To: Christoph Hellwig <hch@lst.de>
Cc: sagi@grimberg.me, anton.eidelman@gmail.com,
	linux-nvme@lists.infradead.org
Subject: Re: [PATCH] nvme: keep ctrl->namespaces ordered
Date: Wed, 15 Sep 2021 07:10:35 -0700	[thread overview]
Message-ID: <20210915141035.GD3778445@dhcp-10-100-145-180.wdc.com> (raw)
In-Reply-To: <20210915072006.956307-1-hch@lst.de>

On Wed, Sep 15, 2021 at 09:20:06AM +0200, Christoph Hellwig wrote:
> +static void nvme_ns_add_to_ctrl_list(struct nvme_ns *ns)
> +{
> +	struct nvme_ns *tmp;
> +
> +	list_for_each_entry_reverse(tmp, &ns->ctrl->namespaces, list) {
> +		if (tmp->head->ns_id < ns->head->ns_id) {
> +			list_add(&tmp->list, &ns->ctrl->namespaces);
> +			return;
> +		}
> +	}
> +
> +	list_add_tail(&ns->list, &ns->ctrl->namespaces);

Actually, this list_add_tail() looks wrong. If the new 'ns' has the
lowest nsid, then we need it added at the head, so this should just be a
"list_add()".

_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

  parent reply	other threads:[~2021-09-15 14:10 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-15  7:20 [PATCH] nvme: keep ctrl->namespaces ordered Christoph Hellwig
2021-09-15  7:36 ` Damien Le Moal
2021-09-15 12:37   ` Keith Busch
2021-09-15 13:47     ` Christoph Hellwig
2021-09-15  9:01 ` Damien Le Moal
2021-09-15 14:02 ` Keith Busch
2021-09-15 14:10 ` Keith Busch [this message]
2021-09-15 15:37 Christoph Hellwig
2021-09-15 15:46 ` Keith Busch
2021-09-15 22:00 ` Damien Le Moal
2021-09-16 16:53 ` Chaitanya Kulkarni
2021-09-19 10:03 ` 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=20210915141035.GD3778445@dhcp-10-100-145-180.wdc.com \
    --to=kbusch@kernel.org \
    --cc=anton.eidelman@gmail.com \
    --cc=hch@lst.de \
    --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.