Re: [PATCH 2/2] scsi: scsi_debug: sdebug_build_parts() respect virtual_gb

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2020-08-27 5:33 p.m., John Pittman wrote:
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.

Signed-off-by: John Pittman <jpittman@xxxxxxxxxx>
---
  drivers/scsi/scsi_debug.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
index 3d9db1e8b781..e6b57cead316 100644
--- a/drivers/scsi/scsi_debug.c
+++ b/drivers/scsi/scsi_debug.c
@@ -5270,7 +5270,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();
  	max_part_secs = sectors_per_part = (num_sectors - sdebug_sectors_per)
  			   / sdebug_num_parts;
  	heads_by_sects = sdebug_heads * sdebug_sectors_per;


Acked-by: Douglas Gilbert <dgilbert@xxxxxxxxxxxx>



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux