nvme-cli: add default value for nsid of write-zeroes
PATCH 1/1 nvme-cli: add default value for nsid of write-zeroes
-L 3772,3778 is doing the default value check and update the nsid if it's not given by the input:
if (!cfg.namespace_id) {
cfg.namespace_id = get_nsid(fd);
if (cfg.namespace_id == 0) {
err = EINVAL;
goto close_fd;
}
}This patch adds nsid default value to zero for the case user does not give the nsid input.
--- nvme.c | 1 + 1 file changed, 1 insertion(+)
nvme.c +1 -0
@@ -3731,6 +3731,7 @@ static int write_zeroes(int argc, char **argv, struct command *cmd, struct plugistruct config cfg = { .start_block =0 , + .namespace_id =0 , .block_count =0 , .prinfo =0 , .ref_tag =0 ,
Signature · 1 line
2.21.0
Sagi Grimberg
maintainerPATCH 1/1 nvme-cli: add default value for nsid of write-zeroes
nvme.c static int write_zeroes(int argc, char **argv, struct command *cmd, struct plugi · line 3734
Quoted 10 lines
nvme.c +1
-0@@ -3731,6 +3731,7 @@ static int write_zeroes(int argc, char **argv, struct command *cmd, struct plugistruct config cfg = { .start_block =0 , + .namespace_id =0 ,
This is implicitly set to 0. You should mention that you add this just for clarification, and its not fixing a bug.
PATCH 1/1 nvme-cli: add default value for nsid of write-zeroes
Quoted 11 lines · Sagi Grimberg
nvme.c static int write_zeroes(int argc, char **argv, struct command *cmd, struct plugi · line 3734
Quoted 9 lines
nvme.c +1
-0@@ -3731,6 +3731,7 @@ static int write_zeroes(int argc, char **argv, struct command *cmd, struct plugistruct config cfg = { .start_block =0 , + .namespace_id =0 ,This is implicitly set to 0. You should mention that you add this just for clarification, and its not fixing a bug.
Is this breaking any testcases or expected behavior ?
Quoted 5 lines
_______________________________________________
Linux-nvme mailing list
Linux-nvme at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
PATCH 1/1 nvme-cli: add default value for nsid of write-zeroes
Quoted 1 line
Is this breaking any testcases or expected behavior ?
Hi Chaitanya,
Thanks for your question. As I replied to Sagi, This patch can be ignored. Sorry for making confusions here. This patch has never caused any issues ever.
Thanks,
PATCH 1/1 nvme-cli: add default value for nsid of write-zeroes
In reply to Sagi GrimbergQuoted 2 lines
This is implicitly set to 0. You should mention that you add this just for clarification, and its not fixing a bug.
Hi Sagi,
Thanks for pointing it out. I should have made the commit more in detail. As you mentioned, the ommitted field members are implicitly initialized to zero by the C99.
I think it can be ignored here.
Thanks :)