summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorKeith Busch <keith.busch@intel.com>2019-04-09 10:03:59 -0600
committerChristoph Hellwig <hch@lst.de>2019-04-11 17:28:30 +0200
commitd808b7f759b50acf0784ce6230ffa63e12ef465d (patch)
tree6e5d46c670e1ed35f4cddadfec3f7b8c563d23cb /include
parent67f471b6ed3b09033c4ac77ea03f92afdb1989fe (diff)
nvmet: fix discover log page when offsets are used
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>
Diffstat (limited to 'include')
-rw-r--r--include/linux/nvme.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/include/linux/nvme.h b/include/linux/nvme.h
index baa49e6a23cc..c40720cb59ac 100644
--- a/include/linux/nvme.h
+++ b/include/linux/nvme.h
@@ -967,8 +967,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];
};