Thread (30 messages) 30 messages, 4 authors, 2021-03-16

Re: [PATCH 02/10] nvme-discover: assume device given on command line is persistent

From: Martin Wilck <hidden>
Date: 2021-03-15 17:51:53

On Mon, 2021-03-15 at 10:41 -0700, Sagi Grimberg wrote:
quoted
From: Martin Wilck <redacted>

After commit "nvme-discover: lookup existing persistent
controllers",
controllers without the "kato" sysfs attribute will never be used
by
do_discover(). This makes sense for controllers found while
traversing
sysfs in find_ctrl_with_connectargs(), but if the user passed a
device explicitly, it should be used, even on older kernels that
don't support the "kato" attribute.

Furthermore, make sure allocated memory in
ctrl_matches_connectargs()
is freed.
This is getting slightly convoluted... what is the motivation again?
Currently, users need to specify *both* connect args *and* a discovery
controller device if they want to reuse an existing discovery
controller, which doesn't make much sense from a usability point of
view. The idea is to simply check if a matching discovery controller is
available.

But if we do that blindly, we may erroneously use a temporary
connection that has been set up by some foreign process, and may go
away under us. That's why we do the kato check. But as you pointed out
yourself in your comment on 01/10, that would completely disable using
existing controllers on older kernels that don't have the "kato"
attribute. This patch changes the behavior such that if no kato-
attribute is found, we trust the user if she specified the controller
explicitly, but we don't trust just random controllers found in sysfs.

Thanks,
Martin




_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help