diff options
author | Martin Wilck <mwilck@suse.com> | 2017-09-28 15:33:23 -0400 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2017-11-11 17:38:21 -0500 |
commit | a04b5de5050ab8b891128eb2c47a0916fe8622e1 (patch) | |
tree | bf9286d61f76f48f9faf05aa4e5f4fbc4388b9d6 | |
parent | ff821d271415f17f1a704600420e92ebb9bfb32c (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>
[hch: rebased to the nvme-4.15 tree to help resolving a conflict]
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
-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 7b3bbc1a9ac4..993813ccdc0b 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c | |||
@@ -2525,7 +2525,7 @@ static umode_t nvme_ns_id_attrs_are_visible(struct kobject *kobj, | |||
2525 | struct nvme_ns_ids *ids = &dev_to_ns_head(dev)->ids; | 2525 | struct nvme_ns_ids *ids = &dev_to_ns_head(dev)->ids; |
2526 | 2526 | ||
2527 | if (a == &dev_attr_uuid.attr) { | 2527 | if (a == &dev_attr_uuid.attr) { |
2528 | if (uuid_is_null(&ids->uuid) || | 2528 | if (uuid_is_null(&ids->uuid) && |
2529 | !memchr_inv(ids->nguid, 0, sizeof(ids->nguid))) | 2529 | !memchr_inv(ids->nguid, 0, sizeof(ids->nguid))) |
2530 | return 0; | 2530 | return 0; |
2531 | } | 2531 | } |