Skip to content

Commit 197f6b0

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) (cherry picked from commit 26e3d68)
1 parent c2a8934 commit 197f6b0

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
@@ -1478,10 +1478,10 @@ static int partition_read_definition(Partition *p, const char *path, const char
14781478
{ "Partition", "Priority", config_parse_int32, 0, &p->priority },
14791479
{ "Partition", "Weight", config_parse_weight, 0, &p->weight },
14801480
{ "Partition", "PaddingWeight", config_parse_weight, 0, &p->padding_weight },
1481-
{ "Partition", "SizeMinBytes", config_parse_size4096, 1, &p->size_min },
1482-
{ "Partition", "SizeMaxBytes", config_parse_size4096, -1, &p->size_max },
1483-
{ "Partition", "PaddingMinBytes", config_parse_size4096, 1, &p->padding_min },
1484-
{ "Partition", "PaddingMaxBytes", config_parse_size4096, -1, &p->padding_max },
1481+
{ "Partition", "SizeMinBytes", config_parse_size4096, -1, &p->size_min },
1482+
{ "Partition", "SizeMaxBytes", config_parse_size4096, 1, &p->size_max },
1483+
{ "Partition", "PaddingMinBytes", config_parse_size4096, -1, &p->padding_min },
1484+
{ "Partition", "PaddingMaxBytes", config_parse_size4096, 1, &p->padding_max },
14851485
{ "Partition", "FactoryReset", config_parse_bool, 0, &p->factory_reset },
14861486
{ "Partition", "CopyBlocks", config_parse_copy_blocks, 0, p },
14871487
{ "Partition", "Format", config_parse_fstype, 0, &p->format },

0 commit comments

Comments
 (0)