nvme: set the PRACT bit when using Write Zeroes with T10 PI
authorChristoph Hellwig <hch@lst.de>
Wed, 21 Jul 2021 08:00:11 +0000 (10:00 +0200)
committerChristoph Hellwig <hch@lst.de>
Wed, 21 Jul 2021 15:24:10 +0000 (17:24 +0200)
commitaaeb7bb061be545251606f4d9c82d710ca2a7c8e
treee3e619dfd62fac8b1a7c8b6220c81af5c7067c59
parent234211b8dd161fa25f192c78d5a8d2dd6bf920a0
nvme: set the PRACT bit when using Write Zeroes with T10 PI

When using Write Zeroes on a namespace that has protection
information enabled they behavior without the PRACT bit
counter-intuitive and will generally lead to validation failures
when reading the written blocks.  Fix this by always setting the
PRACT bit that generates matching PI data on the fly.

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>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/nvme/host/core.c