diff options
author | John Pittman <jpittman@redhat.com> | 2020-09-02 17:14:34 -0400 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2020-09-02 22:49:54 -0400 |
commit | 8c6572356646f700e1679d8f7eb2ab3a4eab678c (patch) | |
tree | 251a04d81c0b23c915b9b45a486522fec355bd36 /drivers/scsi/scsi_debug.c | |
parent | 979e0dc3457cc95e48920ff5ca901a5821ef57d8 (diff) | |
download | linux-8c6572356646f700e1679d8f7eb2ab3a4eab678c.tar.bz2 |
scsi: scsi_debug: Make sdebug_build_parts() respect virtual_gb
If virtual_gb is passed while using num_parts, when creating the
partitions, virtual_gb is not respected. Set num_sectors using
get_sdebug_capacity() to pull virtual_gb if set.
Link: https://lore.kernel.org/r/20200902211434.9979-3-jpittman@redhat.com
Acked-by: Douglas Gilbert <dgilbert@interlog.com>
Signed-off-by: John Pittman <jpittman@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/scsi_debug.c')
-rw-r--r-- | drivers/scsi/scsi_debug.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index 87bbd0967bd8..0a98bdbd5ed4 100644 --- a/drivers/scsi/scsi_debug.c +++ b/drivers/scsi/scsi_debug.c @@ -5276,7 +5276,7 @@ static void sdebug_build_parts(unsigned char *ramp, unsigned long store_size) sdebug_num_parts = SDEBUG_MAX_PARTS; pr_warn("reducing partitions to %d\n", SDEBUG_MAX_PARTS); } - num_sectors = (int)sdebug_store_sectors; + num_sectors = (int)get_sdebug_capacity(); sectors_per_part = (num_sectors - sdebug_sectors_per) / sdebug_num_parts; heads_by_sects = sdebug_heads * sdebug_sectors_per; |