From patchwork Tue Feb 9 20:11:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Williams X-Patchwork-Id: 8265521 Return-Path: X-Original-To: patchwork-linux-nvdimm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C8FF2BEEE5 for ; Tue, 9 Feb 2016 20:11:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 10BA2201EC for ; Tue, 9 Feb 2016 20:11:53 +0000 (UTC) Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3CCA4201BC for ; Tue, 9 Feb 2016 20:11:52 +0000 (UTC) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id E3F351A1DEA; Tue, 9 Feb 2016 12:11:51 -0800 (PST) X-Original-To: linux-nvdimm@lists.01.org Delivered-To: linux-nvdimm@lists.01.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by ml01.01.org (Postfix) with ESMTP id 7BE431A1DEA for ; Tue, 9 Feb 2016 12:11:50 -0800 (PST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 09 Feb 2016 12:11:50 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,422,1449561600"; d="scan'208";a="880684624" Received: from dwillia2-desk3.jf.intel.com (HELO dwillia2-desk3.amr.corp.intel.com) ([10.54.39.136]) by orsmga001.jf.intel.com with ESMTP; 09 Feb 2016 12:11:50 -0800 Subject: [ndctl PATCH] ndctl: fix enabled namespace count From: Dan Williams To: linux-nvdimm@lists.01.org Date: Tue, 09 Feb 2016 12:11:26 -0800 Message-ID: <20160209201120.26511.72536.stgit@dwillia2-desk3.amr.corp.intel.com> User-Agent: StGit/0.17.1-9-g687f MIME-Version: 1.0 X-BeenThere: linux-nvdimm@lists.01.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "Linux-nvdimm developer list." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Tested-by: Linda Knippers Signed-off-by: Dan Williams --- builtin-xaction-namespace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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++; } }