:: commit 857dcbbfe70d3fadcc08d85359246381e505257b

mintsuki <mintsuki@protonmail.com> — 2022-07-01 16:32

parents: 0a7c1be0bb

part: Fix broken sector count normalisation calculation

diff --git a/common/lib/part.s2.c b/common/lib/part.s2.c
index 10c3e457..2bceb998 100644
--- a/common/lib/part.s2.c
+++ b/common/lib/part.s2.c
@@ -209,8 +209,8 @@ static int gpt_get_part(struct volume *ret, struct volume *volume, int partition
     ret->is_optical  = volume->is_optical;
     ret->partition   = partition + 1;
     ret->sector_size = volume->sector_size;
-    ret->first_sect  = entry.starting_lba / (lb_size / 512);
-    ret->sect_count  = ((entry.ending_lba - entry.starting_lba) + 1) / (lb_size / 512);
+    ret->first_sect  = entry.starting_lba * (lb_size / 512);
+    ret->sect_count  = ((entry.ending_lba - entry.starting_lba) + 1) * (lb_size / 512);
     ret->backing_dev = volume;
 
     struct guid guid;
tab: 248 wrap: offon