Skip to content

Commit 26e3d68

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) (cherry picked from commit 5d001f4)
1 parent 4a75edd commit 26e3d68

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
@@ -1559,10 +1559,10 @@ static int partition_read_definition(Partition *p, const char *path, const char
15591559
{ "Partition", "Priority", config_parse_int32, 0, &p->priority },
15601560
{ "Partition", "Weight", config_parse_weight, 0, &p->weight },
15611561
{ "Partition", "PaddingWeight", config_parse_weight, 0, &p->padding_weight },
1562-
{ "Partition", "SizeMinBytes", config_parse_size4096, 1, &p->size_min },
1563-
{ "Partition", "SizeMaxBytes", config_parse_size4096, -1, &p->size_max },
1564-
{ "Partition", "PaddingMinBytes", config_parse_size4096, 1, &p->padding_min },
1565-
{ "Partition", "PaddingMaxBytes", config_parse_size4096, -1, &p->padding_max },
1562+
{ "Partition", "SizeMinBytes", config_parse_size4096, -1, &p->size_min },
1563+
{ "Partition", "SizeMaxBytes", config_parse_size4096, 1, &p->size_max },
1564+
{ "Partition", "PaddingMinBytes", config_parse_size4096, -1, &p->padding_min },
1565+
{ "Partition", "PaddingMaxBytes", config_parse_size4096, 1, &p->padding_max },
15661566
{ "Partition", "FactoryReset", config_parse_bool, 0, &p->factory_reset },
15671567
{ "Partition", "CopyBlocks", config_parse_copy_blocks, 0, p },
15681568
{ "Partition", "Format", config_parse_fstype, 0, &p->format },

0 commit comments

Comments
 (0)