Skip to content

Commit

Permalink
repart: Fix size round up/round down
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
DaanDeMeyer authored and bluca committed Nov 9, 2023
1 parent 4a75edd commit 26e3d68
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/partition/repart.c
Original file line number Diff line number Diff line change
Expand Up @@ -1559,10 +1559,10 @@ static int partition_read_definition(Partition *p, const char *path, const char
{ "Partition", "Priority", config_parse_int32, 0, &p->priority },
{ "Partition", "Weight", config_parse_weight, 0, &p->weight },
{ "Partition", "PaddingWeight", config_parse_weight, 0, &p->padding_weight },
{ "Partition", "SizeMinBytes", config_parse_size4096, 1, &p->size_min },
{ "Partition", "SizeMaxBytes", config_parse_size4096, -1, &p->size_max },
{ "Partition", "PaddingMinBytes", config_parse_size4096, 1, &p->padding_min },
{ "Partition", "PaddingMaxBytes", config_parse_size4096, -1, &p->padding_max },
{ "Partition", "SizeMinBytes", config_parse_size4096, -1, &p->size_min },
{ "Partition", "SizeMaxBytes", config_parse_size4096, 1, &p->size_max },
{ "Partition", "PaddingMinBytes", config_parse_size4096, -1, &p->padding_min },
{ "Partition", "PaddingMaxBytes", config_parse_size4096, 1, &p->padding_max },
{ "Partition", "FactoryReset", config_parse_bool, 0, &p->factory_reset },
{ "Partition", "CopyBlocks", config_parse_copy_blocks, 0, p },
{ "Partition", "Format", config_parse_fstype, 0, &p->format },
Expand Down

0 comments on commit 26e3d68

Please sign in to comment.