Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: hch@infradead.org (Christoph Hellwig)
Subject: [PATCH v3 4/4] nvme_fc: add 'nvme_discovery' sysfs attribute to fc transport device
Date: Wed, 13 Jun 2018 04:33:25 -0700	[thread overview]
Message-ID: <20180613113325.GD18531@infradead.org> (raw)
In-Reply-To: <20180612235028.17969-5-jsmart2021@gmail.com>

On Tue, Jun 12, 2018@04:50:28PM -0700, James Smart wrote:
> The fc transport device should allow for a rediscovery, as userspace
> might have lost the events. Example is udev events not handled during
> system startup.

Please stop adding hacks for your non-standard discovery methods.

> +static void nvme_fc_discovery_unwind(struct list_head *lheadp)
> +{
> +	unsigned long flags;
> +	struct nvme_fc_lport *lport;
> +	struct nvme_fc_rport *rport, *tmp_rport;
> +
> +	list_for_each_entry_safe(rport, tmp_rport,
> +				 lheadp, disc_list) {
> +		spin_lock_irqsave(&nvme_fc_lock, flags);
> +		list_del_init(&rport->disc_list);
> +		spin_unlock_irqrestore(&nvme_fc_lock, flags);

Without the lock taken around the list iteration this is racy.

  reply	other threads:[~2018-06-13 11:33 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-12 23:50 [PATCH v3 0/4] nvme_fc: asynchronous controller create and simple discovery James Smart
2018-06-12 23:50 ` [PATCH v3 1/4] nvme_fc: remove reinit_request routine James Smart
2018-06-13 11:28   ` Christoph Hellwig
2018-06-12 23:50 ` [PATCH v3 2/4] nvme_fc: change controllers first connect to use reconnect path James Smart
2018-06-13 11:31   ` Christoph Hellwig
2018-06-13 15:15     ` James Smart
2018-06-12 23:50 ` [PATCH v3 3/4] nvme_fc: fix nulling of queue data on reconnect James Smart
2018-06-13 11:32   ` Christoph Hellwig
2018-06-12 23:50 ` [PATCH v3 4/4] nvme_fc: add 'nvme_discovery' sysfs attribute to fc transport device James Smart
2018-06-13 11:33   ` Christoph Hellwig [this message]
2018-06-13 15:29     ` James Smart

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=20180613113325.GD18531@infradead.org \
    --to=hch@infradead.org \
    /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