[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 <[email protected]>
Acked-by: Douglas Gilbert <[email protected]>
Acked-by: "Martin K. Petersen" <[email protected]>
Signed-off-by: James Bottomley <[email protected]>
This commit is contained in:
Akinobu Mita 2013-06-29 17:59:17 +09:00 • committed by James Bottomley
commit e9926b4376

View file

@ -2064,6 +2064,11 @@ static void unmap_region(sector_t lba, unsigned int len)
scsi_debug_sector_size *
scsi_debug_unmap_granularity);
}
if (dif_storep) {
memset(dif_storep + lba, 0xff,
sizeof(*dif_storep) *
scsi_debug_unmap_granularity);
}
}
lba = map_index_to_lba(index + 1);
}