part: Fix broken sector count normalisation calculation

This commit is contained in:
mintsuki 2022-07-01 18:32:18 +02:00
parent 0a7c1be0bb
commit 857dcbbfe7
1 changed files with 2 additions and 2 deletions

View File

@ -209,8 +209,8 @@ static int gpt_get_part(struct volume *ret, struct volume *volume, int partition
ret->is_optical = volume->is_optical; ret->is_optical = volume->is_optical;
ret->partition = partition + 1; ret->partition = partition + 1;
ret->sector_size = volume->sector_size; ret->sector_size = volume->sector_size;
ret->first_sect = entry.starting_lba / (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->sect_count = ((entry.ending_lba - entry.starting_lba) + 1) * (lb_size / 512);
ret->backing_dev = volume; ret->backing_dev = volume;
struct guid guid; struct guid guid;