-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nvme_ctrl_alloc() can't handle duplicate connections #154
Comments
Thanks for the report! I don't think your setup is at all unusual for a fabrics target (even if it is "loop"). I'll take a look. |
Hmm. That is true, we don't have a way of distinguish between them. Guess the only way to fix this is to return a list of controllers ... |
Ah, in this case we should at least change the current API so it is possible to return several controllers before we do our 1.0 release. |
I've now prepared PR #219, which should address this issue. Can you test with that? |
With PR #219 I now get: /tmp/nvme list -vSubsystem Subsystem-NQN Controllers nvme-subsys0 nqn.2014-08.org.nvmexpress:NVMf:uuid:95096971-6a11-46a0-8fbc-c301194c5857 nvme2, nvme1, nvme0 Device SN MN FR TxPort Address Subsystem Namespaces nvme2 f51d6e34723a74bea185 Linux 5.16.0-r loop traddr=2 nvme-subsys0 |
PR has been merged. |
Works fine now in my original scenario, thanks. |
Okay, I admit my use case is a little weird and might not reflect real world scenario: loop transport, two (duplicate) connections, resulting in a single subsystem and two controllers in sysfs. The libnvme scanning logic would however only find one controller.
libnvme/src/nvme/tree.c
Lines 1270 to 1271 in ddd725e
Looking at how
nvme_lookup_ctrl()
is called and how are the keys matched inside I see no way to distinguish seemingly duplicate controller entries, just having different name and sysfs path.This is a broader issue, posting now in light of ongoing tree scanning logic rewrite in #108 to get some consideration.
The text was updated successfully, but these errors were encountered: