Re: [PATCH 1/6] disk: part_efi: Size the partition entry array from the block size
Alexey Charkov <[email protected]>
| Newsgroups | org.u-boot-project.lists.u-boot |
|---|---|
| Message-ID | <CAKTNdwHh-MKxHYDjWNgC97Th-4BwbrPoB4irAdBbA7QMa9fBjQ@mail.gmail.com> |
Hello Heinrich, On Tue, Aug 25, 2026 at 10:47 PM Heinrich Schuchardt <[email protected]> wrote: > > On 7/31/26 14:40, Alexey Charkov wrote: > > gpt_fill_header() computes last_usable_lba and first_usable_lba from > > hardcoded block counts that silently assumes 512-byte sectors and the > > Hello Alexey, > > Thank you for fixing this issue. > > Nits: > > %s/assumes/assume/ Ack > > default number of partition entries. > > > The partition entry array holds GPT_ENTRY_NUMBERS entries of 128 bytes > > each, so the number of blocks it needs depends on both the entry count > > The size of the partition table entries is not fixed to 128 bytes. > Instead it is 128 * 2 ** n with n >= 0. The size is stored in field > SizeOfPartitionEntry of the partition table header. > > You already consider this value in gpt_pte_blocks(). It is just the > commit message that is misleading. Ack > > and the block size. write_gpt_table() derives that count correctly and > > writes the backup array at last_usable_lba + 1, so whenever the two > > disagree the backup array no longer immediately precedes the backup GPT > > It remains unclear which two values might "disagree". Will reword in v2, thank you for looking into this! Best regards, Alexey