Skip to content

Commit 236d5ab

Browse files
committed
nvme: print firmware bug note for non-unique identifiers
JIRA: https://issues.redhat.com/browse/RHEL-89350 Upstream Status: RHEL-only If the check in nvme_subsys_check_duplicate_ids() fails, it indicates that an NVMe subsystem is presenting a non-unique identifier. Print a warning indicating the type of non-unique identifer that was detected. Signed-off-by: Bryan Gurney <bgurney@redhat.com>
1 parent c6dac66 commit 236d5ab

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

drivers/nvme/host/core.c

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3526,14 +3526,26 @@ static int nvme_subsys_check_duplicate_ids(struct nvme_subsystem *subsys,
35263526
lockdep_assert_held(&subsys->lock);
35273527

35283528
list_for_each_entry(h, &subsys->nsheads, entry) {
3529-
if (has_uuid && uuid_equal(&ids->uuid, &h->ids.uuid))
3529+
if (has_uuid && uuid_equal(&ids->uuid, &h->ids.uuid)) {
3530+
dev_warn(&subsys->dev,
3531+
"%s: firmware bug: non-unique uuid found\n",
3532+
__func__);
35303533
return -EINVAL;
3534+
}
35313535
if (has_nguid &&
3532-
memcmp(&ids->nguid, &h->ids.nguid, sizeof(ids->nguid)) == 0)
3536+
memcmp(&ids->nguid, &h->ids.nguid, sizeof(ids->nguid)) == 0) {
3537+
dev_warn(&subsys->dev,
3538+
"%s: firmware bug: non-unique nguid found\n",
3539+
__func__);
35333540
return -EINVAL;
3541+
}
35343542
if (has_eui64 &&
3535-
memcmp(&ids->eui64, &h->ids.eui64, sizeof(ids->eui64)) == 0)
3543+
memcmp(&ids->eui64, &h->ids.eui64, sizeof(ids->eui64)) == 0) {
3544+
dev_warn(&subsys->dev,
3545+
"%s: firmware bug: non-unique eui64 found\n",
3546+
__func__);
35363547
return -EINVAL;
3548+
}
35373549
}
35383550

35393551
return 0;

0 commit comments

Comments
 (0)