All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nvme-cli: add default value for nsid of write-zeroes
@ 2019-06-01  7:00 Minwoo Im
  2019-06-02  7:11 ` Sagi Grimberg
       [not found] ` <CGME20190602071216epcas3p254daea15ecd90e3ddbfa3ac7c530bd1f@epcms2p8>
  0 siblings, 2 replies; 5+ messages in thread
From: Minwoo Im @ 2019-06-01  7:00 UTC (permalink / raw)


-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.

Cc: Keith Busch <kbusch at kernel.org>
Signed-off-by: Minwoo Im <minwoo.im.dev at gmail.com>
---
 nvme.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/nvme.c b/nvme.c
index 9819fcb..a7a96a1 100644
--- a/nvme.c
+++ b/nvme.c
@@ -3731,6 +3731,7 @@ static int write_zeroes(int argc, char **argv, struct command *cmd, struct plugi
 
 	struct config cfg = {
 		.start_block     = 0,
+		.namespace_id    = 0,
 		.block_count     = 0,
 		.prinfo          = 0,
 		.ref_tag         = 0,
-- 
2.21.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH] nvme-cli: add default value for nsid of write-zeroes
  2019-06-01  7:00 [PATCH] nvme-cli: add default value for nsid of write-zeroes Minwoo Im
@ 2019-06-02  7:11 ` Sagi Grimberg
  2019-06-02 23:22   ` Chaitanya Kulkarni
       [not found]   ` <CGME20190602232226epcas5p4831fd57de8def05b189bc9bf5c7c5432@epcms2p6>
       [not found] ` <CGME20190602071216epcas3p254daea15ecd90e3ddbfa3ac7c530bd1f@epcms2p8>
  1 sibling, 2 replies; 5+ messages in thread
From: Sagi Grimberg @ 2019-06-02  7:11 UTC (permalink / raw)



> diff --git a/nvme.c b/nvme.c
> index 9819fcb..a7a96a1 100644
> --- a/nvme.c
> +++ b/nvme.c
> @@ -3731,6 +3731,7 @@ static int write_zeroes(int argc, char **argv, struct command *cmd, struct plugi
>   
>   	struct 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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] nvme-cli: add default value for nsid of write-zeroes
  2019-06-02  7:11 ` Sagi Grimberg
@ 2019-06-02 23:22   ` Chaitanya Kulkarni
       [not found]   ` <CGME20190602232226epcas5p4831fd57de8def05b189bc9bf5c7c5432@epcms2p6>
  1 sibling, 0 replies; 5+ messages in thread
From: Chaitanya Kulkarni @ 2019-06-02 23:22 UTC (permalink / raw)


On 6/2/19 12:12 AM, Sagi Grimberg wrote:
>> diff --git a/nvme.c b/nvme.c
>> index 9819fcb..a7a96a1 100644
>> --- a/nvme.c
>> +++ b/nvme.c
>> @@ -3731,6 +3731,7 @@ static int write_zeroes(int argc, char **argv, struct command *cmd, struct plugi
>>   
>>   	struct 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 ?
> _______________________________________________
> Linux-nvme mailing list
> Linux-nvme at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-nvme
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] nvme-cli: add default value for nsid of write-zeroes
       [not found] ` <CGME20190602071216epcas3p254daea15ecd90e3ddbfa3ac7c530bd1f@epcms2p8>
@ 2019-06-03  4:27   ` Minwoo Im
  0 siblings, 0 replies; 5+ messages in thread
From: Minwoo Im @ 2019-06-03  4:27 UTC (permalink / raw)


> 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 :)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] nvme-cli: add default value for nsid of write-zeroes
       [not found]   ` <CGME20190602232226epcas5p4831fd57de8def05b189bc9bf5c7c5432@epcms2p6>
@ 2019-06-03  4:29     ` Minwoo Im
  0 siblings, 0 replies; 5+ messages in thread
From: Minwoo Im @ 2019-06-03  4:29 UTC (permalink / raw)


> 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,

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-06-03  4:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-01  7:00 [PATCH] nvme-cli: add default value for nsid of write-zeroes Minwoo Im
2019-06-02  7:11 ` Sagi Grimberg
2019-06-02 23:22   ` Chaitanya Kulkarni
     [not found]   ` <CGME20190602232226epcas5p4831fd57de8def05b189bc9bf5c7c5432@epcms2p6>
2019-06-03  4:29     ` Minwoo Im
     [not found] ` <CGME20190602071216epcas3p254daea15ecd90e3ddbfa3ac7c530bd1f@epcms2p8>
2019-06-03  4:27   ` Minwoo Im

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.