]> git.baikalelectronics.ru Git - kernel.git/commit
target/file: Fix UNMAP with DIF protection support
authorAkinobu Mita <akinobu.mita@gmail.com>
Mon, 13 Apr 2015 14:21:58 +0000 (23:21 +0900)
committerNicholas Bellinger <nab@linux-iscsi.org>
Thu, 16 Apr 2015 05:47:27 +0000 (22:47 -0700)
commit9b59af444c0deba4a2ee8f24da8217b1dffc1b0e
treeec77072987a3592c3f305cf50257bdfff1ce23fb
parent9aeb0000b8d66ad5d564c938ae69d890cd262e9b
target/file: Fix UNMAP with DIF protection support

When UNMAP command is issued with DIF protection support enabled,
the protection info for the unmapped region is remain unchanged.
So READ command for the region causes data integrity failure.

This fixes it by invalidating protection info for the unmapped region
by filling with 0xff pattern.  This change also adds helper function
fd_do_prot_fill() in order to reduce code duplication with existing
fd_format_prot().

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Reviewed-by: Sagi Grimberg <sagig@mellanox.com>
Reviewed-by: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
Cc: <stable@vger.kernel.org> # v3.14+
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/target/target_core_file.c