aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDouglas Gilbert <dgilbert@interlog.com>2010-04-25 06:30:23 -0400
committerJames Bottomley <James.Bottomley@suse.de>2010-05-02 11:18:55 -0400
commit5447ed6c968e7270b656afa273c2b79d15d82edd (patch)
tree4b38209630c9d9722e42c1b15cf5b642c6c30c1b
parent96b1f96dcab87756c0a1e7ba76bc5dc2add82b88 (diff)
[SCSI] scsi_debug: virtual_gb ignores sector_size
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>
-rw-r--r--drivers/scsi/scsi_debug.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
index 3e10c306de94..3a5bfd10b2cb 100644
--- a/drivers/scsi/scsi_debug.c
+++ b/drivers/scsi/scsi_debug.c
@@ -957,7 +957,8 @@ static int resp_start_stop(struct scsi_cmnd * scp,
957static sector_t get_sdebug_capacity(void) 957static sector_t get_sdebug_capacity(void)
958{ 958{
959 if (scsi_debug_virtual_gb > 0) 959 if (scsi_debug_virtual_gb > 0)
960 return 2048 * 1024 * (sector_t)scsi_debug_virtual_gb; 960 return (sector_t)scsi_debug_virtual_gb *
961 (1073741824 / scsi_debug_sector_size);
961 else 962 else
962 return sdebug_store_sectors; 963 return sdebug_store_sectors;
963} 964}