Rework nvme_scan_subsystem()#324
Merged
hreinecke merged 3 commits intolinux-nvme:masterfrom Mar 31, 2022
Merged
Conversation
tbzatek
approved these changes
Mar 30, 2022
We're always calling nvme_init_subsystem() when nvme_lookup_subsystem() is called with a non-NULL 'name' parameter. So we might as well move it into nvme_lookup_subsystem() and simplify the callers. Signed-off-by: Hannes Reinecke <hare@suse.de>
nvme_scan_ctrl() is iterating over sysfs, so any controller must have a corresponding subsystem; not finding one is an error. Signed-off-by: Hannes Reinecke <hare@suse.de>
The nvme subsystem does not have a 'hostnqn' sysfs entry, so we cannot infer from the nvme subsystem sysfs entry to which host it relates. And really, the subsystem should already have been created by the previous call to nvme_scan_ctrl(). So do not call nvme_lookup_subsystem() in nvme_scan_subystem(), but rather just validate the sysfs subsystem entries and create any missing subsystems. Signed-off-by: Hannes Reinecke <hare@suse.de>
0d63b84 to
1fe56b7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When scanning the subsystem in sysfs we cannot infer the corresponding host that easily, so rework the logic to not allocate the subsystem with the wrong host.