aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2016-04-07 22:59:27 -0400
committerDan Williams <dan.j.williams@intel.com>2016-04-07 22:59:27 -0400
commite5670563f588ed1c0603819350c0f02cec23f5c5 (patch)
treea90e60642e6658cc6fef630d2ee8bec39b1bcbee
parent211291126698c8f047617565b2e2e7f822f86354 (diff)
libnvdimm, pfn: fix uuid validation
If we detect a namespace has a stale info block in the init path, we should overwrite with the latest configuration. In fact, we already return -ENODEV when the parent uuid is invalid, the same should be done for the 'self' uuid. Otherwise we can get into a condition where userspace is unable to reconfigure the pfn-device without directly / manually invalidating the info block. Cc: <stable@vger.kernel.org> Reported-by: Jeff Moyer <jmoyer@redhat.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
-rw-r--r--drivers/nvdimm/pfn_devs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/nvdimm/pfn_devs.c b/drivers/nvdimm/pfn_devs.c
index 254d3bc13f70..e071e214feba 100644
--- a/drivers/nvdimm/pfn_devs.c
+++ b/drivers/nvdimm/pfn_devs.c
@@ -376,7 +376,7 @@ int nd_pfn_validate(struct nd_pfn *nd_pfn)
376 } else { 376 } else {
377 /* from init we validate */ 377 /* from init we validate */
378 if (memcmp(nd_pfn->uuid, pfn_sb->uuid, 16) != 0) 378 if (memcmp(nd_pfn->uuid, pfn_sb->uuid, 16) != 0)
379 return -EINVAL; 379 return -ENODEV;
380 } 380 }
381 381
382 if (nd_pfn->align > nvdimm_namespace_capacity(ndns)) { 382 if (nd_pfn->align > nvdimm_namespace_capacity(ndns)) {