diff options
author | Martin Wilck <mwilck@suse.com> | 2017-09-28 15:33:23 -0400 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2017-10-01 03:58:04 -0400 |
commit | 007a61ae2f35c7fcf767313285c4924e81f11983 (patch) | |
tree | 50d021b575ac183f08ee8e0b8a23e45728c3d719 /drivers | |
parent | a5f3d8a5eaaf917878f07998e6f1ea46024e6bab (diff) |
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@suse.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/nvme/host/core.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index bb2aad078637..5a14cc7f28ee 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c | |||
@@ -2136,7 +2136,7 @@ static umode_t nvme_ns_attrs_are_visible(struct kobject *kobj, | |||
2136 | struct nvme_ns *ns = nvme_get_ns_from_dev(dev); | 2136 | struct nvme_ns *ns = nvme_get_ns_from_dev(dev); |
2137 | 2137 | ||
2138 | if (a == &dev_attr_uuid.attr) { | 2138 | if (a == &dev_attr_uuid.attr) { |
2139 | if (uuid_is_null(&ns->uuid) || | 2139 | if (uuid_is_null(&ns->uuid) && |
2140 | !memchr_inv(ns->nguid, 0, sizeof(ns->nguid))) | 2140 | !memchr_inv(ns->nguid, 0, sizeof(ns->nguid))) |
2141 | return 0; | 2141 | return 0; |
2142 | } | 2142 | } |