]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: target/iblock: fix WRITE SAME zeroing
authorDavid Disseldorp <ddiss@suse.de>
Sun, 19 Apr 2020 16:31:09 +0000 (18:31 +0200)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 22 Apr 2020 04:02:13 +0000 (00:02 -0400)
commit2c8dec281c2d3be98d219efa870240f3f420aef1
tree98706840daa67bac64c7c408c2618abc6b3c8696
parent1367a59ab5ad97c85b0cbb9107719eeb76eced30
scsi: target/iblock: fix WRITE SAME zeroing

SBC4 specifies that WRITE SAME requests with the UNMAP bit set to zero
"shall perform the specified write operation to each LBA specified by the
command".  Commit 599052a4b65b ("target/iblock: Convert WRITE_SAME to
blkdev_issue_zeroout") modified the iblock backend to call
blkdev_issue_zeroout() when handling WRITE SAME requests with UNMAP=0 and a
zero data segment.

The iblock blkdev_issue_zeroout() call incorrectly provides a flags
parameter of 0 (bool false), instead of BLKDEV_ZERO_NOUNMAP.  The bool
false parameter reflects the blkdev_issue_zeroout() API prior to commit
0bc0ea3cc212 ("block: add a flags argument to (__)blkdev_issue_zeroout")
which was merged shortly before 599052a4b65b.

Link: https://lore.kernel.org/r/20200419163109.11689-1-ddiss@suse.de
Fixes: 599052a4b65b ("target/iblock: Convert WRITE_SAME to blkdev_issue_zeroout")
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: David Disseldorp <ddiss@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/target/target_core_iblock.c