diff options
author | Keith Busch <keith.busch@intel.com> | 2019-04-09 10:03:59 -0600 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-05-10 18:36:11 +0200 |
commit | e6f2733f48cb0f11d30813b48965f21cae7cb8c6 (patch) | |
tree | 2785070699b1c3f32c483a20c5e006b3b1777811 /include | |
parent | ea359038ab73da3007f46c6845272bdb43d21482 (diff) |
nvmet: fix discover log page when offsets are used
[ Upstream commit d808b7f759b50acf0784ce6230ffa63e12ef465d ]
The nvme target hadn't been taking the Get Log Page offset parameter
into consideration, and so has been returning corrupted log pages when
offsets are used. Since many tools, including nvme-cli, split the log
request to 4k, we've been breaking discovery log responses when more
than 3 subsystems exist.
Fix the returned data by internally generating the entire discovery
log page and copying only the requested bytes into the user buffer. The
command log page offset type has been modified to a native __le64 to
make it easier to extract the value from a command.
Signed-off-by: Keith Busch <keith.busch@intel.com>
Tested-by: Minwoo Im <minwoo.im@samsung.com>
Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: James Smart <james.smart@broadcom.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/nvme.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/include/linux/nvme.h b/include/linux/nvme.h index bbcc83886899..7ba0368f16e6 100644 --- a/include/linux/nvme.h +++ b/include/linux/nvme.h @@ -975,8 +975,13 @@ struct nvme_get_log_page_command { __le16 numdl; __le16 numdu; __u16 rsvd11; - __le32 lpol; - __le32 lpou; + union { + struct { + __le32 lpol; + __le32 lpou; + }; + __le64 lpo; + }; __u32 rsvd14[2]; }; |