Skip to contentSkip to conversation

nvme: fix visibility of "uuid" ns attribute

PATCH New Martin Wilck 2 participants 2 messages Sep 28, 2017 – Oct 1, 2017 NVMe

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 nvme: fix visibility of "uuid" ns attribute

"uuid" must be invisible if both ns->uuid and ns->nguid are unset, not if either one is.

Fixes d934f9848a77 "nvme: provide UUID value to userspace"
Signed-off-by Martin Wilck <mwilck at suse.com>
---
 drivers/nvme/host/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvme/host/core.c +1 -1
index bb2aad078637..5a14cc7f28ee 100644
@@ -2136,7 +2136,7 @@ static umode_t nvme_ns_attrs_are_visible(struct kobject *kobj,
 	struct nvme_ns *ns = nvme_get_ns_from_dev(dev);
 
 	if (a == &dev_attr_uuid.attr) {
-		if (uuid_is_null(&ns->uuid) ||
+		if (uuid_is_null(&ns->uuid) &&
 		    !memchr_inv(ns->nguid, 0, sizeof(ns->nguid)))
 			return 0;
 	}
Signature · 1 line
2.14.0
maintainer Applied
#1 lore raw

PATCH 1/3 nvme: fix visibility of "uuid" ns attribute

Thanks,

applied to nvme-4.14.