Skip to content

Conversation

hreinecke
Copy link
Collaborator

Calling nvme_reconfigure_ctrl() requires some attributes to be cleared and other to remain constant. This patchset documents the scope of the controller attributes, and also ensures that the code does not trip over an empty 'name' attribute (which is volatile and only set after 'connect' succeeded).

Fixes: #951

Separate out __nvme_deconfigure_ctrl() to make clear which attributes are
to be saved during nvme_reconfigure_ctrl().

Signed-off-by: Hannes Reinecke <[email protected]>
The 'address' attribute is required in nvme_reconfigure_ctrl(), so
we need to update it before calling the function and must not modify
it in nvme_reconfigure_ctrl().

Signed-off-by: Hannes Reinecke <[email protected]>
The controller attributes have a different scope across reconfiguration;
some are immutable, some persist across reconfiguration, and some will
be reset when calling nvme_reconfigure_ctrl().

Signed-off-by: Hannes Reinecke <[email protected]>
…lers

When a controller is disconnected it will just clear the volatile attributes,
but remain part of the tree structure. So when traversing the tree one could
access a disconnected controller, but then c->name is NULL.
So fixup all places calling nvme_ctrl_get_name() to ensure that they don't
crash on an empty name.

Signed-off-by: Hannes Reinecke <[email protected]>
@hreinecke hreinecke changed the title Rework controller reconfiguation Rework controller reconfiguration Sep 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

nvme_disconnect_ctrl followed by a lookup will crash
1 participant