Skip to content

Commit 9ca91ea

Browse files
author
Keith Busch
authored
Merge pull request #554 from birkelund/fix-mbuffer
nvme-cli: prefill metadata buffers
2 parents 977e7d4 + 9b0ab9d commit 9ca91ea

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

nvme.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4857,6 +4857,7 @@ static int submit_io(int opcode, char *command, const char *desc,
48574857
err = -ENOMEM;
48584858
goto free_buffer;
48594859
}
4860+
memset(mbuffer, 0, cfg.metadata_size);
48604861
}
48614862

48624863
if ((opcode & 1)) {
@@ -5422,7 +5423,7 @@ static int passthru(int argc, char **argv, int ioctl_cmd, const char *desc, stru
54225423
const char *dry = "show command instead of sending";
54235424
const char *re = "set dataflow direction to receive";
54245425
const char *wr = "set dataflow direction to send";
5425-
const char *prefill = "prefill buffer with known byte-value, default 0";
5426+
const char *prefill = "prefill buffers with known byte-value, default 0";
54265427

54275428
const struct argconfig_commandline_options command_line_options[] = {
54285429
{"opcode", 'o', "NUM", CFG_BYTE, &cfg.opcode, required_argument, opcode},
@@ -5474,6 +5475,7 @@ static int passthru(int argc, char **argv, int ioctl_cmd, const char *desc, stru
54745475
err = -ENOMEM;
54755476
goto close_wfd;
54765477
}
5478+
memset(metadata, cfg.prefill, cfg.metadata_len);
54775479
}
54785480
if (cfg.data_len) {
54795481
if (posix_memalign(&data, getpagesize(), cfg.data_len)) {

0 commit comments

Comments
 (0)