nvme: fix Write Zeroes limitations
authorChristoph Hellwig <hch@lst.de>
Mon, 15 Mar 2021 09:32:07 +0000 (10:32 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Mar 2021 08:04:07 +0000 (09:04 +0100)
commitfd9e2b99974019a717c975c2c2fa08729ab712f3
treec8919e21d074959743fb13c7321d8518fef86f9c
parent2d202085d2dd53b8364a17050887a805c9e1601f
nvme: fix Write Zeroes limitations

commit b94e8cd2e6a94fc7563529ddc82726a7e77e04de upstream.

We voluntarily limit the Write Zeroes sizes to the MDTS value provided by
the hardware, but currently get the units wrong, so fix that.

Fixes: 6e02318eaea5 ("nvme: add support for the Write Zeroes command")
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Tested-by: Klaus Jensen <k.jensen@samsung.com>
Reviewed-by: Klaus Jensen <k.jensen@samsung.com>
Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/nvme/host/core.c