diff mbox series

[ndctl,03/10] daxctl/device.c: fix json output omission for reconfigure-device

Message ID 20191002234925.9190-4-vishal.l.verma@intel.com (mailing list archive)
State Superseded
Commit 5a808119168d395594f61505fbe310fb5deda95d
Headers show
Series fixes and movability for system-ram mode | expand

Commit Message

Verma, Vishal L Oct. 2, 2019, 11:49 p.m. UTC
The reconfig_mode_{devdax,system_ram}() function can have a positive
return status from memory online/offline operations, indicating skipped
memory blocks. Don't omit printing the device listing json in these
cases; the reconfiguration has succeeded, and its results should be
printed.

Link: https://github.com/pmem/ndctl/issues/115
Reported-by: Michal Biesek <michal.biesek@intel.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
---
 daxctl/device.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Dan Williams Oct. 18, 2019, 6:46 p.m. UTC | #1
On Wed, Oct 2, 2019 at 4:49 PM Vishal Verma <vishal.l.verma@intel.com> wrote:
>
> The reconfig_mode_{devdax,system_ram}() function can have a positive
> return status from memory online/offline operations, indicating skipped
> memory blocks. Don't omit printing the device listing json in these
> cases; the reconfiguration has succeeded, and its results should be
> printed.
>
> Link: https://github.com/pmem/ndctl/issues/115
> Reported-by: Michal Biesek <michal.biesek@intel.com>
> Cc: Dan Williams <dan.j.williams@intel.com>
> Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>

Reviewed-by: Dan Williams <dan.j.williams@intel.com>
diff mbox series

Patch

diff --git a/daxctl/device.c b/daxctl/device.c
index 4887ccf..920efc6 100644
--- a/daxctl/device.c
+++ b/daxctl/device.c
@@ -398,7 +398,7 @@  static int do_reconfig(struct daxctl_dev *dev, enum dev_mode mode,
 		rc = -EINVAL;
 	}
 
-	if (rc)
+	if (rc < 0)
 		return rc;
 
 	*jdevs = json_object_new_array();