]> git.baikalelectronics.ru Git - kernel.git/commit
nvmet: fix discover log page when offsets are used
authorKeith Busch <keith.busch@intel.com>
Tue, 9 Apr 2019 16:03:59 +0000 (10:03 -0600)
committerChristoph Hellwig <hch@lst.de>
Thu, 11 Apr 2019 15:28:30 +0000 (17:28 +0200)
commitb284b8c1b594e312f90e3c737b8046484514030b
tree6e5d46c670e1ed35f4cddadfec3f7b8c563d23cb
parent6e0dce4430d20ee651cb2ec4ce45ef66c216f20d
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>
drivers/nvme/target/admin-cmd.c
drivers/nvme/target/discovery.c
drivers/nvme/target/nvmet.h
include/linux/nvme.h