aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorAkinobu Mita <akinobu.mita@gmail.com>2013-06-29 04:59:17 -0400
committerJames Bottomley <JBottomley@Parallels.com>2013-07-09 04:24:25 -0400
commite9926b4376544d5a2dc4d310d4d0006c634b1a93 (patch)
tree2d1fbe3341b66fe39e57c49d5c562cadaddc3f4c /drivers/scsi
parent7cb69d0397233546d82191e524235fdb9d1d91aa (diff)
[SCSI] scsi_debug: invalidate protection info for unmapped region
When UNMAP command is issued with the data integrity support enabled, the protection info for the unmapped region is remain unchanged. So READ command for the region later on causes data integrity failure. This fixes it by invalidating protection info for the unmapped region by filling with 0xff pattern. Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Acked-by: Douglas Gilbert <dgilbert@interlog.com> Acked-by: "Martin K. Petersen" <martin.petersen@oracle.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/scsi_debug.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
index e83e661b0257..83efec2919b1 100644
--- a/drivers/scsi/scsi_debug.c
+++ b/drivers/scsi/scsi_debug.c
@@ -2064,6 +2064,11 @@ static void unmap_region(sector_t lba, unsigned int len)
2064 scsi_debug_sector_size * 2064 scsi_debug_sector_size *
2065 scsi_debug_unmap_granularity); 2065 scsi_debug_unmap_granularity);
2066 } 2066 }
2067 if (dif_storep) {
2068 memset(dif_storep + lba, 0xff,
2069 sizeof(*dif_storep) *
2070 scsi_debug_unmap_granularity);
2071 }
2067 } 2072 }
2068 lba = map_index_to_lba(index + 1); 2073 lba = map_index_to_lba(index + 1);
2069 } 2074 }