]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitd4bb8da09d765bc4a3ba7003a9e3437d9c7efaf6
treee3e619dfd62fac8b1a7c8b6220c81af5c7067c59
parent6b9b2825141b13f94d7a456c8532e1825d86b523
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: 15e6d6fe45a5 ("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