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 <[email protected]>
---
 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
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm

Reply via email to