diff options
author | Hannes Reinecke <hare@suse.de> | 2018-07-16 13:58:33 +0300 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2018-09-17 16:49:40 +0300 |
commit | be1277f5eb17a2e5788139eabb0b53dd04c695f3 (patch) | |
tree | be8593a04dc35a6a369067e13017f73e5bb24a74 /drivers | |
parent | b228ba1cb95afbaeeb86cf06cd9fd6f6369c3b14 (diff) | |
download | linux-be1277f5eb17a2e5788139eabb0b53dd04c695f3.tar.xz |
nvme: count all ANA groups for ANA Log page
When issuing a short read on the ANA log page the number of groups
should not change, even though the final returned data might contain
less groups than that number.
Signed-off-by: Hannes Reinecke <hare@suse.com>
[switched to a for loop]
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/nvme/target/admin-cmd.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/nvme/target/admin-cmd.c b/drivers/nvme/target/admin-cmd.c index a21caea1e080..2008fa62a373 100644 --- a/drivers/nvme/target/admin-cmd.c +++ b/drivers/nvme/target/admin-cmd.c @@ -245,6 +245,10 @@ static void nvmet_execute_get_log_page_ana(struct nvmet_req *req) offset += len; ngrps++; } + for ( ; grpid <= NVMET_MAX_ANAGRPS; grpid++) { + if (nvmet_ana_group_enabled[grpid]) + ngrps++; + } hdr.chgcnt = cpu_to_le64(nvmet_ana_chgcnt); hdr.ngrps = cpu_to_le16(ngrps); |