Skip to content

Commit 5d001f4

Browse files
DaanDeMeyerbluca
authored andcommitted
repart: Fix size round up/round down
Currently, we round minimum sizes up and maximum size down, whereas it should be the opposite as the current approach means that if the same size is used for min and max, the min size will end up bigger than the max size after rounding. (cherry picked from commit 6563aed)
1 parent 0a35850 commit 5d001f4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/partition/repart.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1611,10 +1611,10 @@ static int partition_read_definition(Partition *p, const char *path, const char
16111611
{ "Partition", "Priority", config_parse_int32, 0, &p->priority },
16121612
{ "Partition", "Weight", config_parse_weight, 0, &p->weight },
16131613
{ "Partition", "PaddingWeight", config_parse_weight, 0, &p->padding_weight },
1614-
{ "Partition", "SizeMinBytes", config_parse_size4096, 1, &p->size_min },
1615-
{ "Partition", "SizeMaxBytes", config_parse_size4096, -1, &p->size_max },
1616-
{ "Partition", "PaddingMinBytes", config_parse_size4096, 1, &p->padding_min },
1617-
{ "Partition", "PaddingMaxBytes", config_parse_size4096, -1, &p->padding_max },
1614+
{ "Partition", "SizeMinBytes", config_parse_size4096, -1, &p->size_min },
1615+
{ "Partition", "SizeMaxBytes", config_parse_size4096, 1, &p->size_max },
1616+
{ "Partition", "PaddingMinBytes", config_parse_size4096, -1, &p->padding_min },
1617+
{ "Partition", "PaddingMaxBytes", config_parse_size4096, 1, &p->padding_max },
16181618
{ "Partition", "FactoryReset", config_parse_bool, 0, &p->factory_reset },
16191619
{ "Partition", "CopyBlocks", config_parse_copy_blocks, 0, p },
16201620
{ "Partition", "Format", config_parse_fstype, 0, &p->format },

0 commit comments

Comments
 (0)