nvme: fix handling of metadata_len for NVME_IOCTL_IO_CMD
authorRoland Dreier <roland@purestorage.com>
Fri, 20 Jul 2018 03:07:59 +0000 (20:07 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 24 Aug 2018 11:09:21 +0000 (13:09 +0200)
commit7a12f4ed07a5f7b49c7d4f86ea67f65ec953cc40
tree474cfaff72bd050b67ddabba30d93581f4913b15
parent0ee106583f9c6fe2eccb5dbb9eb9562abbcba7ac
nvme: fix handling of metadata_len for NVME_IOCTL_IO_CMD

[ Upstream commit 9b382768135ee3ff282f828c906574a8478e036b ]

The old code in nvme_user_cmd() passed the userspace virtual address
from nvme_passthru_cmd.metadata as the length of the metadata buffer
as well as the address to nvme_submit_user_cmd().

Fixes: 63263d60 ("nvme: Use metadata for passthrough commands")
Signed-off-by: Roland Dreier <roland@purestorage.com>
Reviewed-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/nvme/host/core.c