mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 0/6] GPT: fixes around last_usable_lba
@ 2026-07-01  9:27 Sascha Hauer
  2026-07-01  9:27 ` [PATCH 1/6] partitions: gpt: Adjust last_usable_lba to real device size when writing Sascha Hauer
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Sascha Hauer @ 2026-07-01  9:27 UTC (permalink / raw)
  To: BAREBOX; +Cc: Sascha Hauer

The last_usable_lba field in a GPT specifies just that: The last LBA we
are allowed to use for partitions. There are some bugs around that fixed
in this series:

- When creating partitions we never actually check against
  last_usable_lba, but instead the device end.
- When writing a disk image to a device the last_usable_lba is usually
  set to some value matching the image size. When writing the partition
  table later, adjust the value for the actual device size so that the
  full device becomes usable

Also some logging fixes/cleanups included

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
Sascha Hauer (6):
      partitions: gpt: Adjust last_usable_lba to real device size when writing
      partitions: gpt: refresh also when primary or alternate is invalid
      partitions: gpt: validate mkpart range against GPT usable LBAs
      partitions: check new partitions against usable LBAs, not device size
      partitions: gpt: fix wrong error messages
      partitions: gpt: log a message when partition table refreshed

 commands/parted.c       |  8 +-------
 common/partitions.c     | 28 +++++++++++++++++++-------
 common/partitions/efi.c | 53 +++++++++++++++++++++++++++++++++++--------------
 include/partitions.h    |  2 ++
 4 files changed, 62 insertions(+), 29 deletions(-)
---
base-commit: 18599acfcbf38e95edc605f89e257e32f67d0ac4
change-id: 20260701-gpt-size-fixes-fa23624e09b0

Best regards,
-- 
Sascha Hauer <s.hauer@pengutronix.de>




^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-07-01  9:32 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-01  9:27 [PATCH 0/6] GPT: fixes around last_usable_lba Sascha Hauer
2026-07-01  9:27 ` [PATCH 1/6] partitions: gpt: Adjust last_usable_lba to real device size when writing Sascha Hauer
2026-07-01  9:27 ` [PATCH 2/6] partitions: gpt: refresh also when primary or alternate is invalid Sascha Hauer
2026-07-01  9:27 ` [PATCH 3/6] partitions: gpt: validate mkpart range against GPT usable LBAs Sascha Hauer
2026-07-01  9:27 ` [PATCH 4/6] partitions: check new partitions against usable LBAs, not device size Sascha Hauer
2026-07-01  9:27 ` [PATCH 5/6] partitions: gpt: fix wrong error messages Sascha Hauer
2026-07-01  9:27 ` [PATCH 6/6] partitions: gpt: log a message when partition table refreshed Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox