]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: scsi_debug: Adjust num_parts to create equally sized partitions
authorJohn Pittman <jpittman@redhat.com>
Wed, 2 Sep 2020 21:14:33 +0000 (17:14 -0400)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 3 Sep 2020 02:49:53 +0000 (22:49 -0400)
commitc2ad573d8d6bf74695f5c5ccdb583f0e10de85a7
tree4d28460464549158b055f1277f77132720ff8b5b
parent6dcd519ee3903927858f0d9455ad684f36555688
scsi: scsi_debug: Adjust num_parts to create equally sized partitions

Currently when using the num_parts parameter, partitions are aligned and
the end sector is one prior to the next start.  This creates different
sized partitions. Create instead equally sized partitions by trimming the
end of each partition to the size of the smallest partition.  This aligns
better with what one would expect from automatically created partitions and
can be helpful with testing things such as raid which often expect legs of
the same size.  Minimal space is lost as the initial partition starting
size is calculated by dividing num_sectors by sdebug_num_parts.

Link: https://lore.kernel.org/r/20200902211434.9979-2-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>
drivers/scsi/scsi_debug.c