From patchwork Wed Oct 2 23:49:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Verma, Vishal L" X-Patchwork-Id: 11171925 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 44FE914DB for ; Wed, 2 Oct 2019 23:49:41 +0000 (UTC) Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2DB24222BE for ; Wed, 2 Oct 2019 23:49:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2DB24222BE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-nvdimm-bounces@lists.01.org Received: from new-ml01.vlan13.01.org (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id B3EF5100DC43B; Wed, 2 Oct 2019 16:50:55 -0700 (PDT) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=134.134.136.24; helo=mga09.intel.com; envelope-from=vishal.l.verma@intel.com; receiver= Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 885BB100DC415 for ; Wed, 2 Oct 2019 16:50:52 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Oct 2019 16:49:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,250,1566889200"; d="scan'208";a="195032104" Received: from vverma7-desk1.lm.intel.com ([10.232.112.164]) by orsmga003.jf.intel.com with ESMTP; 02 Oct 2019 16:49:34 -0700 From: Vishal Verma To: Subject: [ndctl PATCH 03/10] daxctl/device.c: fix json output omission for reconfigure-device Date: Wed, 2 Oct 2019 17:49:18 -0600 Message-Id: <20191002234925.9190-4-vishal.l.verma@intel.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191002234925.9190-1-vishal.l.verma@intel.com> References: <20191002234925.9190-1-vishal.l.verma@intel.com> MIME-Version: 1.0 Message-ID-Hash: 3LDVNNYNEM56RZJMYOXQVCMEQHPO2KG7 X-Message-ID-Hash: 3LDVNNYNEM56RZJMYOXQVCMEQHPO2KG7 X-MailFrom: vishal.l.verma@intel.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header CC: Dave Hansen , Ben Olson , Michal Biesek X-Mailman-Version: 3.1.1 Precedence: list List-Id: "Linux-nvdimm developer list." Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: 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 Cc: Dan Williams Signed-off-by: Vishal Verma Reviewed-by: Dan Williams --- daxctl/device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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();