提交 e00f9add 编写于 作者: D David Disseldorp 提交者: Yang Yingliang

scsi: target/iblock: fix WRITE SAME zeroing

commit 1d2ff149 upstream.

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 2237498f ("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
ee472d83 ("block: add a flags argument to (__)blkdev_issue_zeroout")
which was merged shortly before 2237498f.

Link: https://lore.kernel.org/r/20200419163109.11689-1-ddiss@suse.de
Fixes: 2237498f ("target/iblock: Convert WRITE_SAME to blkdev_issue_zeroout")
Reviewed-by: NBart Van Assche <bvanassche@acm.org>
Signed-off-by: NDavid Disseldorp <ddiss@suse.de>
Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 8765fc06
...@@ -445,7 +445,7 @@ iblock_execute_zero_out(struct block_device *bdev, struct se_cmd *cmd) ...@@ -445,7 +445,7 @@ iblock_execute_zero_out(struct block_device *bdev, struct se_cmd *cmd)
target_to_linux_sector(dev, cmd->t_task_lba), target_to_linux_sector(dev, cmd->t_task_lba),
target_to_linux_sector(dev, target_to_linux_sector(dev,
sbc_get_write_same_sectors(cmd)), sbc_get_write_same_sectors(cmd)),
GFP_KERNEL, false); GFP_KERNEL, BLKDEV_ZERO_NOUNMAP);
if (ret) if (ret)
return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE; return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册