diff mbox

[ndctl,2/9] test, libndctl: invalidate dax info blocks before reuse

Message ID 146698347889.40541.8448936636550885217.stgit@dwillia2-desk3.amr.corp.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Dan Williams June 26, 2016, 11:24 p.m. UTC
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 mbox

Patch

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);