All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Williams <dan.j.williams@intel.com>
To: linux-nvdimm@lists.01.org
Subject: [ndctl PATCH 2/9] test, libndctl: invalidate dax info blocks before reuse
Date: Sun, 26 Jun 2016 16:24:38 -0700	[thread overview]
Message-ID: <146698347889.40541.8448936636550885217.stgit@dwillia2-desk3.amr.corp.intel.com> (raw)
In-Reply-To: <146698346627.40541.14661847967712551305.stgit@dwillia2-desk3.amr.corp.intel.com>

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 <dan.j.williams@intel.com>
---
 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);

_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

  parent reply	other threads:[~2016-06-26 23:25 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-26 23:24 [ndctl PATCH 0/9] updates for vmalloc-based nfit_test and device-dax Dan Williams
2016-06-26 23:24 ` [ndctl PATCH 1/9] ndctl: deprecate pcommit Dan Williams
2016-06-26 23:24 ` Dan Williams [this message]
2016-06-26 23:24 ` [ndctl PATCH 3/9] ndctl, list: list device-dax instances beneath a namespace Dan Williams
2016-06-26 23:24 ` [ndctl PATCH 4/9] ndctl, list: allow limiting namespace listing Dan Williams
2016-06-27 19:28   ` Vishal Verma
2016-06-27 19:38     ` Dan Williams
2016-06-26 23:24 ` [ndctl PATCH 5/9] ndctl: add libs dependency to spec file Dan Williams
2016-06-26 23:24 ` [ndctl PATCH 6/9] ndctl, create-namespace: fix blk-namepsaces vs device-dax Dan Williams
2016-06-26 23:25 ` [ndctl PATCH 7/9] ndctl, create-namespace: fix device-dax vs --map= Dan Williams
2016-06-26 23:25 ` [ndctl PATCH 8/9] test, libndctl: move pfn + dax configurations to a destructive test Dan Williams
2016-06-26 23:25 ` [ndctl PATCH 9/9] test, libndctl: kill some dead code Dan Williams
2016-06-27 11:37 ` [ndctl PATCH 0/9] updates for vmalloc-based nfit_test and device-dax Yigal Korman
2016-06-27 23:04 ` Vishal Verma

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=146698347889.40541.8448936636550885217.stgit@dwillia2-desk3.amr.corp.intel.com \
    --to=dan.j.williams@intel.com \
    --cc=linux-nvdimm@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.