Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: jsmart2021@gmail.com (James Smart)
Subject: [PATCH v3 4/4] nvme_fc: add 'nvme_discovery' sysfs attribute to fc transport device
Date: Wed, 13 Jun 2018 08:29:04 -0700	[thread overview]
Message-ID: <1b96039c-53d7-f899-d400-18217e4146c2@gmail.com> (raw)
In-Reply-To: <20180613113325.GD18531@infradead.org>

On 6/13/2018 4:33 AM, Christoph Hellwig wrote:
> 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.

Please stop these boorish anti-fc comments. There is nothing 
non-standard or hackish about fc's discovery methods.

This patch simply addresses an issue that arises as nvme discovery isn't 
in-kernel thus has a relationship to the boot process.


> 
>> +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.
> 

how so ?

this list was built up ahead of time solely for this routine, gets are 
done on all objects as they were added to the list, the list isn't 
changed except for deleting elements from the list by this routine, and 
a port can't get on this list twice. I don't see the race.

-- james

      reply	other threads:[~2018-06-13 15:29 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
2018-06-13 15:29     ` James Smart [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=1b96039c-53d7-f899-d400-18217e4146c2@gmail.com \
    --to=jsmart2021@gmail.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