From patchwork Fri Mar 11 00:45:21 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Williams X-Patchwork-Id: 8561131 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 DB6ABC0555 for ; Fri, 11 Mar 2016 00:45:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 122BF20383 for ; Fri, 11 Mar 2016 00:45:50 +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 2A20A20389 for ; Fri, 11 Mar 2016 00:45:49 +0000 (UTC) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 3E0681A1F6A; Thu, 10 Mar 2016 16:46:04 -0800 (PST) X-Original-To: linux-nvdimm@lists.01.org Delivered-To: linux-nvdimm@lists.01.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by ml01.01.org (Postfix) with ESMTP id 0F3A41A1F6A for ; Thu, 10 Mar 2016 16:46:03 -0800 (PST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP; 10 Mar 2016 16:45:47 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,318,1455004800"; d="scan'208";a="762040272" Received: from dwillia2-desk3.jf.intel.com ([10.54.39.14]) by orsmga003.jf.intel.com with ESMTP; 10 Mar 2016 16:45:47 -0800 Subject: [ndctl PATCH 2/3] ndctl: disable nfit_test regions after test From: Dan Williams To: linux-nvdimm@lists.01.org Date: Thu, 10 Mar 2016 16:45:21 -0800 Message-ID: <20160311004521.27582.16889.stgit@dwillia2-desk3.jf.intel.com> In-Reply-To: <20160311004511.27582.63304.stgit@dwillia2-desk3.jf.intel.com> References: <20160311004511.27582.63304.stgit@dwillia2-desk3.jf.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=-1.9 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 Ensure that all nfit_test regions are disabled after a successful test so the module can be removed. Otherwise test/libndctl will not run back-to-back runs in the case of "make TESTS=test/libndctl check". Signed-off-by: Dan Williams --- test/libndctl.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/libndctl.c b/test/libndctl.c index 2601117333a4..ca1d7515d406 100644 --- a/test/libndctl.c +++ b/test/libndctl.c @@ -482,11 +482,11 @@ static int check_btts(struct ndctl_region *region, struct btt **btts); static int check_regions(struct ndctl_bus *bus, struct region *regions, int n, enum ns_mode mode) { + struct ndctl_region *region; int i, rc = 0; for (i = 0; i < n; i++) { struct ndctl_interleave_set *iset; - struct ndctl_region *region; char devname[50]; if (strcmp(regions[i].type, "pmem") == 0) @@ -566,6 +566,10 @@ static int check_regions(struct ndctl_bus *bus, struct region *regions, int n, break; } + if (rc == 0) + ndctl_region_foreach(bus, region) + ndctl_region_disable_invalidate(region); + return rc; }