diff options
author | Akinobu Mita <akinobu.mita@gmail.com> | 2013-08-26 22:08:41 +0900 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2013-09-03 07:28:08 -0700 |
commit | a027b5b90eb6b5ec5c5890a5e4e198f458ae94cb (patch) | |
tree | d8406f527912266c7568a8d6f7e9eb64f92e14c9 /drivers/scsi/sg.c | |
parent | 150c3544b1d317fe32b1f279917c08638dad363f (diff) | |
download | linux-stable-a027b5b90eb6b5ec5c5890a5e4e198f458ae94cb.tar.gz linux-stable-a027b5b90eb6b5ec5c5890a5e4e198f458ae94cb.tar.bz2 linux-stable-a027b5b90eb6b5ec5c5890a5e4e198f458ae94cb.zip |
[SCSI] scsi_debug: fix logical block provisioning support when unmap_alignment != 0
Commit b90ebc3d5c41c9164ae04efd2e4f8204c2a186f1 ("[SCSI] scsi_debug:
fix logical block provisioning support") fixed several issues with
logical block provisioning support, but it still doesn't properly fix
the cases when unmap_alignment > 0.
For example, load scsi_debug module with the following module parameters
and make all blocks mapped by filling the storage with zero.
# modprobe scsi_debug lbpu=1 unmap_alignment=1 unmap_granularity=4
# dd if=/dev/zero of=$DEV
Then, try to unmap the first unmappable blocks at lba=1, but GET LBA STATUS
unexpectedly reports that the last UNMAP has done nothing.
# sg_unmap --lba=1 --num=4 $DEV
# sg_get_lba_status --lba=1 $DEV
descriptor LBA: 0x0000000000000001 blocks: 16383 mapped
The problem is in map_index_to_lba(), which should return the first
LBA which is corresponding to a given index of provisioning map
(map_storep).
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Acked-by: "Martin K. Petersen" <martin.petersen@oracle.com>
Acked-by: Douglas Gilbert <dgilbert@interlog.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/sg.c')
0 files changed, 0 insertions, 0 deletions