Skip to content

Commit

Permalink
nvme: fix visibility of "uuid" ns attribute
Browse files Browse the repository at this point in the history
"uuid" must be invisible if both ns->uuid and ns->nguid are unset,
not if either one is.

Fixes: d934f98 "nvme: provide UUID value to userspace"
Signed-off-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
  • Loading branch information
Martin Wilck authored and Christoph Hellwig committed Oct 1, 2017
1 parent a5f3d8a commit 007a61a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/nvme/host/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 007a61a

Please sign in to comment.