Commit 820fa2f
nvme: apply user-specified timeout via transport handle
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).
Rather than adding cmd.timeout_ms assignments at every call site, set
the timeout once on the transport handle in parse_and_open() and apply
it in libnvme_submit_admin_passthru() and libnvme_submit_io_passthru()
when the command's own timeout_ms is 0. Commands that set a non-zero
timeout_ms (e.g. format's 600s default) are unaffected.
This covers all built-in commands, all vendor plugins, and all internal
libnvme callers (nvme-cmds.c, tree.c, fabrics.c) without requiring
per-call-site changes.
libnvme changes:
- Add __u32 timeout field to struct libnvme_transport_handle
- Add libnvme_transport_handle_set_timeout() public API
- Apply handle timeout in submit_admin_passthru/submit_io_passthru
- Export new symbol in LIBNVME_4 version section
Signed-off-by: Nick Wolff <[email protected]>
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>1 parent 80d8492 commit 820fa2f
6 files changed
Lines changed: 35 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
196 | 199 | | |
197 | 200 | | |
198 | 201 | | |
| |||
202 | 205 | | |
203 | 206 | | |
204 | 207 | | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
205 | 211 | | |
206 | 212 | | |
207 | 213 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
140 | 146 | | |
141 | 147 | | |
142 | 148 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
216 | 216 | | |
217 | 217 | | |
218 | 218 | | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
219 | 232 | | |
220 | 233 | | |
221 | 234 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
| 153 | + | |
| 154 | + | |
153 | 155 | | |
154 | 156 | | |
155 | 157 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
381 | 381 | | |
382 | 382 | | |
383 | 383 | | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
384 | 387 | | |
385 | 388 | | |
386 | 389 | | |
| |||
0 commit comments