From patchwork Sun Jun 26 23:24:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Williams X-Patchwork-Id: 9199771 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E37FF60752 for ; Sun, 26 Jun 2016 23:25:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D1DB328553 for ; Sun, 26 Jun 2016 23:25:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C567D2855A; Sun, 26 Jun 2016 23:25:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 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.wl.linuxfoundation.org (Postfix) with ESMTPS id 89F4728553 for ; Sun, 26 Jun 2016 23:25:22 +0000 (UTC) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 1E5BB1A1E01; Sun, 26 Jun 2016 16:25:56 -0700 (PDT) X-Original-To: linux-nvdimm@lists.01.org Delivered-To: linux-nvdimm@lists.01.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by ml01.01.org (Postfix) with ESMTP id 4677F1A1E01 for ; Sun, 26 Jun 2016 16:25:55 -0700 (PDT) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga103.fm.intel.com with ESMTP; 26 Jun 2016 16:25:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,533,1459839600"; d="scan'208";a="128902169" Received: from dwillia2-desk3.jf.intel.com (HELO dwillia2-desk3.amr.corp.intel.com) ([10.54.39.14]) by fmsmga004.fm.intel.com with ESMTP; 26 Jun 2016 16:25:22 -0700 Subject: [ndctl PATCH 2/9] test, libndctl: invalidate dax info blocks before reuse From: Dan Williams To: linux-nvdimm@lists.01.org Date: Sun, 26 Jun 2016 16:24:38 -0700 Message-ID: <146698347889.40541.8448936636550885217.stgit@dwillia2-desk3.amr.corp.intel.com> In-Reply-To: <146698346627.40541.14661847967712551305.stgit@dwillia2-desk3.amr.corp.intel.com> References: <146698346627.40541.14661847967712551305.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.21 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-Virus-Scanned: ClamAV using ClamSMTP A recent kernel fix addressed cases where a live setting change mismatches with the current contents of the info block. Rather than silently overwrite the new settings with the info block contents the kernel now invalidates the info block if the uuid changes, but otherwise warns if a setting is mismatched. Signed-off-by: Dan Williams --- test/libndctl.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/libndctl.c b/test/libndctl.c index 147f69d0c27a..8346108aacec 100644 --- a/test/libndctl.c +++ b/test/libndctl.c @@ -787,6 +787,12 @@ static int check_dax_create(struct ndctl_region *region, for (i = 0; i < ARRAY_SIZE(dax_s->locs); i++) { fprintf(stderr, "%s: %ld\n", __func__, ARRAY_SIZE(dax_s->aligns)); for (j = 0; j < ARRAY_SIZE(dax_s->aligns); j++) { + /* + * The kernel enforces invalidating the previous + * info block when the current uuid is does not + * validate with the contents of the info block. + */ + dax_s->uuid[0]++; rc = __check_dax_create(region, ndns, namespace, dax_s->locs[i], dax_s->aligns[j], dax_s->uuid); @@ -923,6 +929,12 @@ static int check_pfn_create(struct ndctl_region *region, for (i = 0; i < ARRAY_SIZE(pfn_s->locs); i++) { for (j = 0; j < ARRAY_SIZE(pfn_s->aligns); j++) { + /* + * The kernel enforces invalidating the previous + * info block when the current uuid is does not + * validate with the contents of the info block. + */ + pfn_s->uuid[0]++; rc = __check_pfn_create(region, ndns, namespace, buf, pfn_s->locs[i], pfn_s->aligns[j], pfn_s->uuid);