diff mbox

ndctl: fix inverted mem vs. dev map argument to create-namespace

Message ID x49k2msnq8f.fsf@segfault.boston.devel.redhat.com (mailing list archive)
State Accepted
Commit 16c0c72ec865
Headers show

Commit Message

Jeff Moyer Jan. 29, 2016, 7:24 p.m. UTC
Again, simple think-o.

Signed-off-by: Jeff Moyer <jmoyer@redhat.com>

Comments

Dan Williams Jan. 29, 2016, 7:57 p.m. UTC | #1
On Fri, Jan 29, 2016 at 11:24 AM, Jeff Moyer <jmoyer@redhat.com> wrote:
> Again, simple think-o.
>
> Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
>
> diff --git a/builtin-xaction-namespace.c b/builtin-xaction-namespace.c
> index 4135e04..3c4c3e8 100644
> --- a/builtin-xaction-namespace.c
> +++ b/builtin-xaction-namespace.c
> @@ -379,7 +379,7 @@ static int validate_namespace_options(struct ndctl_namespace *ndns,
>         }
>
>         if (param.map) {
> -               if (strcmp(param.map, "mem"))
> +               if (!strcmp(param.map, "mem"))
>                         p->loc = NDCTL_PFN_LOC_RAM;
>                 else
>                         p->loc = NDCTL_PFN_LOC_PMEM;


Looks good, thanks!
diff mbox

Patch

diff --git a/builtin-xaction-namespace.c b/builtin-xaction-namespace.c
index 4135e04..3c4c3e8 100644
--- a/builtin-xaction-namespace.c
+++ b/builtin-xaction-namespace.c
@@ -379,7 +379,7 @@  static int validate_namespace_options(struct ndctl_namespace *ndns,
 	}
 
 	if (param.map) {
-		if (strcmp(param.map, "mem"))
+		if (!strcmp(param.map, "mem"))
 			p->loc = NDCTL_PFN_LOC_RAM;
 		else
 			p->loc = NDCTL_PFN_LOC_PMEM;