From: Sagi Grimberg <sagi@grimberg.me>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Christoph Hellwig <hch@lst.de>,
linux-nvme@lists.infradead.org,
Keith Busch <keith.busch@intel.com>,
James Smart <james.smart@broadcom.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 3/3] nvme: fire discovery log page change events to userspace
Date: Fri, 30 Aug 2019 11:14:39 -0700 [thread overview]
Message-ID: <73e3d2ca-33e0-3133-9dfb-62b07e5b09c4@grimberg.me> (raw)
In-Reply-To: <20190830062036.GA15257@kroah.com>
>>>>>> You are correct that this information can be derived from sysfs, but the
>>>>>> main reason why we add these here, is because in udev rule we can't
>>>>>> just go ahead and start looking these up and parsing these..
>>>>>>
>>>>>> We could send the discovery aen with NVME_CTRL_NAME and have
>>>>>> then have systemd run something like:
>>>>>>
>>>>>> nvme connect-all -d nvme0 --sysfs
>>>>>>
>>>>>> and have nvme-cli retrieve all this stuff from sysfs?
>>>>>
>>>>> Actually that may be a problem.
>>>>>
>>>>> There could be a hypothetical case where after the event was fired
>>>>> and before it was handled, the discovery controller went away and
>>>>> came back again with a different controller instance, and the old
>>>>> instance is now a different discovery controller.
>>>>>
>>>>> This is why we need this information in the event. And we verify this
>>>>> information in sysfs in nvme-cli.
>>>>
>>>> Well, that must be a usual issue with uevents, right? Don't we usually
>>>> have a increasing serial number for that or something?
>>>
>>> Yes we do, userspace should use it to order events. Does udev not
>>> handle that properly today?
>>
>> The problem is not ordering of events, its really about the fact that
>> the chardev can be removed and reallocated for a different controller
>> (could be a completely different discovery controller) by the time
>> that userspace handles the event.
>
> So? You will have gotten the remove and then new addition uevent in
> order showing you this. So your userspace code knows that something
> went away and then came back properly so you should be kept in sync.
Still don't understand how this is ok...
I have /dev/nvme0 represents a network endpoint that I would discover
from, it is raising me an event to do a discovery operation (namely to
issue an ioctl to it) so my udev code calls a systemd script.
By the time I actually get to do that, /dev/nvme0 represents now a new
network endpoint (where the event is no longer relevant to). I would
rather the discovery to explicitly fail than to give me something
different, so we pass some arguments that we verify in the operation.
Its a stretch case, but it was raised by people as a potential issue.
next prev parent reply other threads:[~2019-08-30 18:14 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20190712180211.26333-1-sagi@grimberg.me>
[not found] ` <20190712180211.26333-4-sagi@grimberg.me>
[not found] ` <20190822002328.GP9511@lst.de>
[not found] ` <205d06ab-fedc-739d-323f-b358aff2cbfe@grimberg.me>
[not found] ` <e4603511-6dae-e26d-12a9-e9fa727a8d03@grimberg.me>
2019-08-26 6:56 ` Christoph Hellwig
2019-08-26 7:59 ` Greg Kroah-Hartman
2019-08-29 18:21 ` Sagi Grimberg
2019-08-30 5:55 ` Christoph Hellwig
2019-08-30 18:08 ` Sagi Grimberg
2019-08-30 18:36 ` James Smart
2019-08-30 21:07 ` Sagi Grimberg
2019-08-30 22:24 ` James Smart
2019-09-09 15:10 ` Hannes Reinecke
2019-08-30 6:20 ` Greg Kroah-Hartman
2019-08-30 18:14 ` Sagi Grimberg [this message]
2019-09-02 19:33 ` Greg Kroah-Hartman
2019-09-04 1:35 ` Sagi Grimberg
2019-09-04 5:25 ` Greg Kroah-Hartman
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=73e3d2ca-33e0-3133-9dfb-62b07e5b09c4@grimberg.me \
--to=sagi@grimberg.me \
--cc=gregkh@linuxfoundation.org \
--cc=hch@lst.de \
--cc=james.smart@broadcom.com \
--cc=keith.busch@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvme@lists.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
all inboxes | Powered by JetHome®