On 2026-09-28T06:40:33, Sumit Singh Dhami <[email protected]> wrote:
> disk: part_efi: fix first/last usable LBA computation
>
> gpt_fill_header() hard-codes 32 blocks for the GPT Partition Entry
> Array when computing first_usable_lba, and 34 (32 PTE blocks + 1
> primary header block + 1 for the last LBA offset) for
> last_usable_lba. These values are only correct when the block size
> is 512 bytes and the default 16 KB Partition Entry Array size is used.
>
> Compute the number of blocks required for the PTE based on device's
> actual block size and use this value in place of the hard-coded
> constants, so the first/last usable LBA are calculated correctly.
>
> Signed-off-by: Sumit Singh Dhami <[email protected]>
>
> disk/part_efi.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)

Reviewed-by: Simon Glass <[email protected]>

Reply via email to