mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
[SCSI] scsi_debug: clear correct memory region when LBPRZ is enabled
The function unmap_region() clears memory region specified as the logical block address and the number of logical blocks in ramdisk storage (fake_storep) if lbpu and lbprz module parameters are enabled. In the while loop of unmap_region(), it advances optimal unmap granularity in logical blocks. But it only clears one logical block at LBA 'block' per loop iteration. And furthermore, the 'block' is not pointing to a logical block address which should be cleared, it is a index of probisioning map (map_storep). Signed-off-by: Akinobu Mita <[email protected]> Acked-by: Martin K. Petersen <[email protected]> Signed-off-by: James Bottomley <[email protected]>
This commit is contained in:
parent
ac17078ae6
commit
cc34a8e663
1 changed files with 3 additions and 2 deletions
|
|
@ -2059,8 +2059,9 @@ static void unmap_region(sector_t lba, unsigned int len)
|
|||
clear_bit(block, map_storep);
|
||||
if (scsi_debug_lbprz)
|
||||
memset(fake_storep +
|
||||
block * scsi_debug_sector_size, 0,
|
||||
scsi_debug_sector_size);
|
||||
lba * scsi_debug_sector_size, 0,
|
||||
scsi_debug_sector_size *
|
||||
scsi_debug_unmap_granularity);
|
||||
}
|
||||
lba += granularity - rem;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue