aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/nvdimm/namespace_devs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/nvdimm/namespace_devs.c')
-rw-r--r--drivers/nvdimm/namespace_devs.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/drivers/nvdimm/namespace_devs.c b/drivers/nvdimm/namespace_devs.c
index e101aec186c7..7aba9a569c8e 100644
--- a/drivers/nvdimm/namespace_devs.c
+++ b/drivers/nvdimm/namespace_devs.c
@@ -2065,12 +2065,20 @@ struct device *create_namespace_blk(struct nd_region *nd_region,
2065 struct device *dev = NULL; 2065 struct device *dev = NULL;
2066 struct resource *res; 2066 struct resource *res;
2067 2067
2068 if (namespace_label_has(ndd, type_guid) 2068 if (namespace_label_has(ndd, type_guid)) {
2069 && !guid_equal(&nd_set->type_guid, 2069 if (!guid_equal(&nd_set->type_guid, &nd_label->type_guid)) {
2070 &nd_label->type_guid)) { 2070 dev_dbg(ndd->dev, "expect type_guid %pUb got %pUb\n",
2071 dev_dbg(ndd->dev, "expect type_guid %pUb got %pUb\n", 2071 nd_set->type_guid.b,
2072 nd_set->type_guid.b, nd_label->type_guid.b); 2072 nd_label->type_guid.b);
2073 return ERR_PTR(-EAGAIN); 2073 return ERR_PTR(-EAGAIN);
2074 }
2075
2076 if (nd_label->isetcookie != __cpu_to_le64(nd_set->cookie2)) {
2077 dev_dbg(ndd->dev, "expect cookie %#llx got %#llx\n",
2078 nd_set->cookie2,
2079 __le64_to_cpu(nd_label->isetcookie));
2080 return ERR_PTR(-EAGAIN);
2081 }
2074 } 2082 }
2075 2083
2076 nsblk = kzalloc(sizeof(*nsblk), GFP_KERNEL); 2084 nsblk = kzalloc(sizeof(*nsblk), GFP_KERNEL);