Skip to contentSkip to conversation

nvme: print warning on non-unique namespace identifier

PATCH In review Bryan Gurney 1 participant 1 message May 9, 2025 NVMe

lore
Share & tools
lore
#0 lore raw

PATCH 2/2 nvme: print warning on non-unique namespace identifier

If a duplicate ID is detected, print a warning about a suspected firmware bug, that a non-unique identifier was found.

---
 drivers/nvme/host/core.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)
drivers/nvme/host/core.c +12 -3
index 49ca29c64ca9..5670c25d1144 100644
@@ -3579,8 +3579,11 @@ static int nvme_subsys_check_duplicate_ids(struct nvme_subsystem *subsys,
 
 	if (has_uuid) {
 		list_for_each_entry(h, &subsys->nsheads, entry)
-			if (uuid_equal(&ids->uuid, &h->ids.uuid))
+			if (uuid_equal(&ids->uuid, &h->ids.uuid)) {
+				dev_warn(&subsys->dev,
+					 "firmware bug: non-unique uuid found\n");
 				return -EINVAL;
+			}
 		return 0;
 	}
 
@@ -3588,8 +3591,11 @@ static int nvme_subsys_check_duplicate_ids(struct nvme_subsystem *subsys,
 		list_for_each_entry(h, &subsys->nsheads, entry)
 			if (memcmp(&ids->nguid,
 				   &h->ids.nguid,
-				   sizeof(ids->nguid)) == 0)
+				   sizeof(ids->nguid)) == 0) {
+				dev_warn(&subsys->dev,
+					 "firmware bug: non-unique nguid found\n");
 				return -EINVAL;
+			}
 		return 0;
 	}
 
@@ -3597,8 +3603,11 @@ static int nvme_subsys_check_duplicate_ids(struct nvme_subsystem *subsys,
 		list_for_each_entry(h, &subsys->nsheads, entry)
 			if (memcmp(&ids->eui64,
 				   &h->ids.eui64,
-				   sizeof(ids->eui64)) == 0)
+				   sizeof(ids->eui64)) == 0) {
+				dev_warn(&subsys->dev,
+					 "firmware bug: non-unique eui64 found\n");
 				return -EINVAL;
+			}
 		return 0;
 	}
 
Signature · 1 line
2.49.0