cmd_disable_dimm() expects a negative number for an error, otherwise we
end up reporting:

    # ndctl disable-dimm nmem1
    nmem1 is active, skipping...
    disabled 16 dimms

...instead of:

    # ndctl disable-dimm nmem1
    nmem1 is active, skipping...
    error disabling dimms: Device or resource busy

Reported-by: Vishal Verma <vishal.l.ve...@intel.com>
Signed-off-by: Dan Williams <dan.j.willi...@intel.com>
---
 ndctl/builtin-xable-dimm.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ndctl/builtin-xable-dimm.c b/ndctl/builtin-xable-dimm.c
index 4bdbc7f8eea3..f0d298837aeb 100644
--- a/ndctl/builtin-xable-dimm.c
+++ b/ndctl/builtin-xable-dimm.c
@@ -67,7 +67,7 @@ static int do_xable_dimm(const char *dimm_arg,
 
        rc = success;
        if (!success && skip)
-               rc = EBUSY;
+               rc = -EBUSY;
  out:
        dimm_bus = NULL;
        return rc;

_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

Reply via email to