diff mbox

[ndctl] ndctl: fix enabled namespace count

Message ID 20160209201120.26511.72536.stgit@dwillia2-desk3.amr.corp.intel.com (mailing list archive)
State Accepted
Commit e87000589106
Headers show

Commit Message

Dan Williams Feb. 9, 2016, 8:11 p.m. UTC
We under-report the number of enabled namespaces when those namespaces
are claimed by another interface.  This is due to the fact that
ndctl_namespace_enable() returns a postive number when the enable
successfully triggers a different device to go active.

Reported-by: Linda Knippers <linda.knippers@hpe.com>
Tested-by: Linda Knippers <linda.knippers@hpe.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
 builtin-xaction-namespace.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

diff --git a/builtin-xaction-namespace.c b/builtin-xaction-namespace.c
index f4645d866e0f..28999b3f8311 100644
--- a/builtin-xaction-namespace.c
+++ b/builtin-xaction-namespace.c
@@ -621,7 +621,7 @@  static int do_xaction_namespace(const char *namespace,
 				case ACTION_CREATE:
 					return namespace_reconfig(region, ndns);
 				}
-				if (rc == 0)
+				if (rc >= 0)
 					success++;
 			}
 		}