scsi: target/iblock: fix WRITE SAME zeroing
Subsystems (2)
PATCH 1/1 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".2237498f0b5c 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 ee472d835c264, which was merged shortly before 2237498f0b5c.
--- drivers/target/target_core_iblock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/target/target_core_iblock.c +1 -1
@@ -432,7 +432,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,sbc_get_write_same_sectors (cmd)), - GFP_KERNEL, false); + GFP_KERNEL, BLKDEV_ZERO_NOUNMAP);if (ret)return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE ;
Signature · 1 line
2.16.4
Quoted 9 lines · David Disseldorp
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".
2237498f0b5cmodified the iblock backend to callblkdev_issue_zeroout()when handling WRITE SAME requests with UNMAP=0 and a zero data segment. The iblockblkdev_issue_zeroout()call incorrectly provides a flags parameter of 0 (bool false), instead ofBLKDEV_ZERO_NOUNMAP. The bool false parameter reflects theblkdev_issue_zeroout()API prior toee472d835c264, which was merged shortly before2237498f0b5c.
Martin K. Petersen
AppliedDavid,
Quoted 9 lines
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".
2237498f0b5cmodified the iblock backend to callblkdev_issue_zeroout()when handling WRITE SAME requests with UNMAP=0 and a zero data segment. The iblockblkdev_issue_zeroout()call incorrectly provides a flags parameter of 0 (bool false), instead ofBLKDEV_ZERO_NOUNMAP. The bool false parameter reflects theblkdev_issue_zeroout()API prior toee472d835c264, which was merged shortly before2237498f0b5c.
Applied to 5.7/scsi-fixes, thanks!
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering