From: Sagi Grimberg <sagi@grimberg.me>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Keith Busch <keith.busch@intel.com>,
linux-kernel@vger.kernel.org, Christoph Hellwig <hch@lst.de>,
linux-nvme@lists.infradead.org,
James Smart <james.smart@broadcom.com>
Subject: Re: [PATCH v2 3/3] nvme: fire discovery log page change events to userspace
Date: Tue, 3 Sep 2019 18:35:30 -0700 [thread overview]
Message-ID: <f9204955-a1b3-796a-dc4f-fd7af7946635@grimberg.me> (raw)
In-Reply-To: <20190902193341.GA28723@kroah.com>
>> 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.
>
> Ok, and how do you handle this same thing for something like /dev/sda ?
> (hint, it isn't new, and is something we solved over a decade ago)
>
> If you worry about stuff like this, use a persistant device naming
> scheme and have your device node be pointed to by a symlink. Create
> that symlink by using the information in the initial 'ADD' uevent.
>
> That way, when userspace opens the device node, it "knows" exactly which
> one it opens. It sounds like you have a bunch of metadata to describe
> these uniquely, so pass that in the ADD event, not in some other crazy
> non-standard manner.
We could send these variables when adding the device and then validating
them using a rich-text-explanatory symlink. Seems slightly backwards to
me, but that would work too.
We create the char device using device_add (in nvme_init_subsystem),
I didn't find any way to append env variables to that ADD uevent.
Did you mean that we should add another flavor of device_add that
accepts char *envp_ext[]?
What exactly is the "standard manner" to pass these variables to
the chardev KOBJ_ADD uevent? All other examples I could find use
KOBJ_CHANGE to pass private stuff..
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
next prev parent reply other threads:[~2019-09-04 1:35 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-12 18:02 [PATCH v2 0/3] Support discovery log change events Sagi Grimberg
2019-07-12 18:02 ` [PATCH v2 1/3] nvme-fabrics: allow discovery subsystems accept a kato Sagi Grimberg
2019-07-14 8:08 ` Minwoo Im
2019-07-14 15:00 ` James Smart
2019-07-19 13:48 ` Hannes Reinecke
2019-07-12 18:02 ` [PATCH v2 2/3] nvme: enable aen also for discovery controllers Sagi Grimberg
2019-07-14 8:09 ` Minwoo Im
2019-07-14 15:04 ` James Smart
2019-07-19 13:49 ` Hannes Reinecke
2019-07-12 18:02 ` [PATCH v2 3/3] nvme: fire discovery log page change events to userspace Sagi Grimberg
2019-07-14 8:14 ` Minwoo Im
2019-07-14 15:13 ` James Smart
2019-07-19 13:49 ` Hannes Reinecke
[not found] ` <20190822002328.GP9511@lst.de>
[not found] ` <205d06ab-fedc-739d-323f-b358aff2cbfe@grimberg.me>
[not found] ` <e4603511-6dae-e26d-12a9-e9fa727a8d03@grimberg.me>
[not found] ` <20190826065639.GA11036@lst.de>
[not found] ` <20190826075916.GA30396@kroah.com>
[not found] ` <ac168168-fed2-2b57-493e-e88261ead73b@grimberg.me>
[not found] ` <20190830055514.GC8492@lst.de>
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
[not found] ` <20190830062036.GA15257@kroah.com>
2019-08-30 18:14 ` Sagi Grimberg
2019-09-02 19:33 ` Greg Kroah-Hartman
2019-09-04 1:35 ` Sagi Grimberg [this message]
2019-09-04 5:25 ` Greg Kroah-Hartman
2019-08-01 1:32 ` [PATCH v2 0/3] Support discovery log change events 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=f9204955-a1b3-796a-dc4f-fd7af7946635@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;
as well as URLs for NNTP newsgroup(s).