Skip to content

Commit

Permalink
[SCSI] scsi_debug: virtual_gb ignores sector_size
Browse files Browse the repository at this point in the history
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: Douglas Gilbert <dgilbert@interlog.com>
Cc: Stable Tree <stable@kernel.org>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
  • Loading branch information
Douglas Gilbert authored and James Bottomley committed May 2, 2010
1 parent 96b1f96 commit 5447ed6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/scsi/scsi_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -957,7 +957,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;
}
Expand Down

0 comments on commit 5447ed6

Please sign in to comment.