mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-10 15:10:38 +00:00
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>
This commit is contained in:
parent
979e0dc345
commit
8c65723566
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user