Repository navigation
libnvme: do not delete existing config files when an install fails - #4483
Merged
Merged
Conversation
added 2 commits
November 30, 2026 07:18
The config reader rejects a [Host] section with a hostnqn and no hostid. "nvme config create -q <hostnqn>" without "-I" wrote such a section, and every later read of the configuration failed. Take the hostid from a UUID-based hostnqn, as nvme connect does. Reject any other hostnqn without a hostid. Signed-off-by: Martin Belanger <martin.belanger@dell.com>
On failure, libnvmf_config_emit_install() removed every destination file, also files it had not replaced yet. "nvme config create" always installs with force, so a failed write (ENOSPC, EIO) deleted drop-ins of a working configuration. Remove only the temporary files. Fixes: b5f6b15 ("libnvme/config: add the configuration write side") Signed-off-by: Martin Belanger <martin.belanger@dell.com>
martin-belanger
force-pushed
the
config-emit-hostid
branch
from
November 30, 2026 12:19
ba68691 to
ef39586
Compare
libnvmf_context_set_hostnqn() had its own copy of libnvme_hostid_from_hostnqn(). Use the shared function, and remove its duplicate declaration from private-tree.h. Signed-off-by: Martin Belanger <martin.belanger@dell.com>
Collaborator
|
Thanks! |
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.
Two fixes in the config emitter, and a cleanup:
libnvme_hostid_from_hostnqn(). It now uses the shared function.The first two commits each add a test that fails without the fix. The third moves the existing unit test to the shared function.