Skip to content

Commit 5403c60

Browse files
Martin Belangerclaude
andcommitted
nvmf: fix timeout not applied to discovery log commands
args->timeout was set in the discovery args struct but never copied into cmd.timeout_ms before issuing the log page commands, so the caller-specified timeout had no effect. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> Signed-off-by: Martin Belanger <[email protected]>
1 parent 3e86668 commit 5403c60

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

libnvme/src/nvme/fabrics.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1319,6 +1319,7 @@ static int nvme_discovery_log(const struct libnvme_get_discovery_args *args,
13191319
libnvme_msg(ctx, LOG_DEBUG, "%s: get header (try %d/%d)\n",
13201320
name, retries, args->max_retries);
13211321
nvme_init_get_log_discovery(&cmd, 0, log, DISCOVERY_HEADER_LEN);
1322+
cmd.timeout_ms = args->timeout;
13221323
err = libnvme_get_log(hdl, &cmd, false, DISCOVERY_HEADER_LEN);
13231324
if (err) {
13241325
libnvme_msg(ctx, LOG_INFO,
@@ -1350,6 +1351,7 @@ static int nvme_discovery_log(const struct libnvme_get_discovery_args *args,
13501351
name, numrec, genctr);
13511352

13521353
nvme_init_get_log_discovery(&cmd, sizeof(*log), log->entries, entries_size);
1354+
cmd.timeout_ms = args->timeout;
13531355
cmd.cdw10 |= NVME_FIELD_ENCODE(args->lsp,
13541356
NVME_LOG_CDW10_LSP_SHIFT,
13551357
NVME_LOG_CDW10_LSP_MASK);
@@ -1368,6 +1370,7 @@ static int nvme_discovery_log(const struct libnvme_get_discovery_args *args,
13681370
libnvme_msg(ctx, LOG_DEBUG, "%s: get header again\n", name);
13691371

13701372
nvme_init_get_log_discovery(&cmd, 0, log, DISCOVERY_HEADER_LEN);
1373+
cmd.timeout_ms = args->timeout;
13711374
err = libnvme_get_log(hdl, &cmd, false, DISCOVERY_HEADER_LEN);
13721375
if (err) {
13731376
libnvme_msg(ctx, LOG_INFO,

0 commit comments

Comments
 (0)