linux-nvdimm.lists.01.org archive mirror
 help / color / mirror / Atom feed
* [ndctl PATCH] infoblock: Make output mutually exclusive
@ 2020-07-07 16:46 Harish
  2020-07-07 19:06 ` Ira Weiny
  2020-07-08  6:22 ` Harish
  0 siblings, 2 replies; 3+ messages in thread
From: Harish @ 2020-07-07 16:46 UTC (permalink / raw)
  To: linux-nvdimm, dan.j.williams, vishal.l.verma; +Cc: Harish

Patch fixes checking output filter option (-o <file> or -c) of
write-infoblock command to be mutually exclusive.

Signed-off-by: Harish <harish@linux.ibm.com>
---
 ndctl/namespace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ndctl/namespace.c b/ndctl/namespace.c
index 0550580..d3ade25 100644
--- a/ndctl/namespace.c
+++ b/ndctl/namespace.c
@@ -440,7 +440,7 @@ static const char *parse_namespace_options(int argc, const char **argv,
 		rc = -EINVAL;
 	}
 
-	if (action == ACTION_WRITE_INFOBLOCK && (param.outfile || param.std_out)
+	if (action == ACTION_WRITE_INFOBLOCK && (param.outfile && param.std_out)
 			&& argc) {
 		error("specify only one of a namespace filter, --output, or --stdout\n");
 		rc = -EINVAL;
-- 
2.26.2
_______________________________________________
Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
To unsubscribe send an email to linux-nvdimm-leave@lists.01.org

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

* Re: [ndctl PATCH] infoblock: Make output mutually exclusive
  2020-07-07 16:46 [ndctl PATCH] infoblock: Make output mutually exclusive Harish
@ 2020-07-07 19:06 ` Ira Weiny
  2020-07-08  6:22 ` Harish
  1 sibling, 0 replies; 3+ messages in thread
From: Ira Weiny @ 2020-07-07 19:06 UTC (permalink / raw)
  To: Harish; +Cc: linux-nvdimm

On Tue, Jul 07, 2020 at 10:16:35PM +0530, Harish wrote:
> Patch fixes checking output filter option (-o <file> or -c) of
> write-infoblock command to be mutually exclusive.
> 
> Signed-off-by: Harish <harish@linux.ibm.com>

Looks reasonable to me.

Reviewed-by: Ira Weiny <ira.weiny@intel.com>

> ---
>  ndctl/namespace.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/ndctl/namespace.c b/ndctl/namespace.c
> index 0550580..d3ade25 100644
> --- a/ndctl/namespace.c
> +++ b/ndctl/namespace.c
> @@ -440,7 +440,7 @@ static const char *parse_namespace_options(int argc, const char **argv,
>  		rc = -EINVAL;
>  	}
>  
> -	if (action == ACTION_WRITE_INFOBLOCK && (param.outfile || param.std_out)
> +	if (action == ACTION_WRITE_INFOBLOCK && (param.outfile && param.std_out)
>  			&& argc) {
>  		error("specify only one of a namespace filter, --output, or --stdout\n");
>  		rc = -EINVAL;
> -- 
> 2.26.2
> _______________________________________________
> Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
> To unsubscribe send an email to linux-nvdimm-leave@lists.01.org
_______________________________________________
Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
To unsubscribe send an email to linux-nvdimm-leave@lists.01.org

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

* Re: [ndctl PATCH] infoblock: Make output mutually exclusive
  2020-07-07 16:46 [ndctl PATCH] infoblock: Make output mutually exclusive Harish
  2020-07-07 19:06 ` Ira Weiny
@ 2020-07-08  6:22 ` Harish
  1 sibling, 0 replies; 3+ messages in thread
From: Harish @ 2020-07-08  6:22 UTC (permalink / raw)
  To: linux-nvdimm, dan.j.williams, vishal.l.verma; +Cc: santosh, ira.weiny

This patch can be dropped as the error specifies namespace filter also 
is mutually exclusive
with these options, so this is not needed. The usage confused me as it 
portrays namespace
filtering to be mandatory as opposed to the Documentation.

Command line:
usage: ndctl write-infoblock <namespace> [<options>]

Sorry for the noise.

- Harish

On 7/7/20 10:16 PM, Harish wrote:
> Patch fixes checking output filter option (-o <file> or -c) of
> write-infoblock command to be mutually exclusive.
>
> Signed-off-by: Harish <harish@linux.ibm.com>
> ---
>   ndctl/namespace.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/ndctl/namespace.c b/ndctl/namespace.c
> index 0550580..d3ade25 100644
> --- a/ndctl/namespace.c
> +++ b/ndctl/namespace.c
> @@ -440,7 +440,7 @@ static const char *parse_namespace_options(int argc, const char **argv,
>   		rc = -EINVAL;
>   	}
>   
> -	if (action == ACTION_WRITE_INFOBLOCK && (param.outfile || param.std_out)
> +	if (action == ACTION_WRITE_INFOBLOCK && (param.outfile && param.std_out)
>   			&& argc) {
>   		error("specify only one of a namespace filter, --output, or --stdout\n");
>   		rc = -EINVAL;
_______________________________________________
Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
To unsubscribe send an email to linux-nvdimm-leave@lists.01.org

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

end of thread, other threads:[~2020-07-08  6:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-07 16:46 [ndctl PATCH] infoblock: Make output mutually exclusive Harish
2020-07-07 19:06 ` Ira Weiny
2020-07-08  6:22 ` Harish

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).