nvme: apply user-specified timeout to all admin passthru commands#3302
Merged
igaw merged 1 commit intolinux-nvme:masterfrom Apr 22, 2026
Merged
Conversation
Collaborator
|
I suggest something simpler, set timeout on the handle and use this value when submitting in ioctl.c: In v1 we passed the timeout value around using always the default value with a few exception. For special cases we can still do the approach you suggest, but I would like to avoid this if possible. |
4fc98fe to
22c96c0
Compare
Contributor
Author
|
@igaw yes I see that's much cleaner. Sorry for brute force I will refactor |
22c96c0 to
820fa2f
Compare
Contributor
Author
|
@igaw Updated |
The --timeout / -t flag is parsed into nvme_args.timeout but was only honored by format-nvm and admin-passthru. All other commands left cmd.timeout_ms at 0 (set by nvme_init_*() helpers), silently falling back to the kernel's admin_timeout (60s). Signed-off-by: Nick Wolff <[email protected]> Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
820fa2f to
a438889
Compare
Collaborator
|
I've updated some formatting (nitpicking), moved linker symbol into the correct section and trimmed the commit message. Thanks! |
|
Unrelated to this commit, but in |
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.
The --timeout / -t flag is parsed into nvme_args.timeout but was only applied to format-nvm and admin-passthru. All other commands that use nvme_init_*() helpers followed by libnvme_submit_admin_passthru() had their timeout_ms left at 0 (memset by the init functions), silently falling back to the kernel's admin_timeout (60s).
This meant commands like delete-ns, create-ns, attach-ns, detach-ns, sanitize, fw-download, fw-commit, device-self-test, security-send, security-receive, capacity-mgmt, and all identify passthru commands ignored the user-supplied timeout.
Set cmd.timeout_ms = nvme_args.timeout after every nvme_init_*() call and before submission. When -t is not given, nvme_args.timeout is NVME_DEFAULT_IOCTL_TIMEOUT (0), preserving the existing kernel-default behavior.