Skip to content

Commit 1d2ff14

Browse files
ddissmartinkpetersen
authored andcommitted
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 2237498 ("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 ee472d8 ("block: add a flags argument to (__)blkdev_issue_zeroout") which was merged shortly before 2237498. Link: https://lore.kernel.org/r/[email protected] Fixes: 2237498 ("target/iblock: Convert WRITE_SAME to blkdev_issue_zeroout") Reviewed-by: Bart Van Assche <[email protected]> Signed-off-by: David Disseldorp <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 5a26389 commit 1d2ff14

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/target/target_core_iblock.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ iblock_execute_zero_out(struct block_device *bdev, struct se_cmd *cmd)
432432
target_to_linux_sector(dev, cmd->t_task_lba),
433433
target_to_linux_sector(dev,
434434
sbc_get_write_same_sectors(cmd)),
435-
GFP_KERNEL, false);
435+
GFP_KERNEL, BLKDEV_ZERO_NOUNMAP);
436436
if (ret)
437437
return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE;
438438

0 commit comments

Comments
 (0)