Commit cc9a2362 authored by Douglas Gilbert's avatar Douglas Gilbert Committed by Greg Kroah-Hartman

scsi_debug: virtual_gb ignores sector_size

commit 5447ed6c upstream.

In the scsi_debug driver, the virtual_gb option ignores the
sector_size, implicitly assuming that is 512 bytes.  So if
'virtual_gb=1 sector_size=4096' the result is an 8 GB (virtual) disk.
Signed-off-by: default avatarDouglas Gilbert <dgilbert@interlog.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent ec5e50f0
......@@ -914,7 +914,8 @@ static int resp_start_stop(struct scsi_cmnd * scp,
static sector_t get_sdebug_capacity(void)
{
if (scsi_debug_virtual_gb > 0)
return 2048 * 1024 * (sector_t)scsi_debug_virtual_gb;
return (sector_t)scsi_debug_virtual_gb *
(1073741824 / scsi_debug_sector_size);
else
return sdebug_store_sectors;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment