git: gpt(8): Fix two bugs in "expand" command
Aaron LI
aly at crater.dragonflybsd.org
Sun Sep 27 01:00:58 PDT 2026
commit f6a10901992fcc728b7380721d9e5f48c97cff7a
Author: David Bidner <david at crap.solutions>
Date: Sun Sep 27 15:04:42 2026 +0800
gpt(8): Fix two bugs in "expand" command
* Commit f4b4c056f1 introduced a regression to the "expand" command that
the existing secondary GPT header and table were not relocated to the
new end of the expanded disk, leaving the primary GPT header pointing
at a non-existent secondary GPT. A second run would then creates it.
Fix the regression by always setting the 'map_start' of the existing
secondary GPT header and table to correctly relocate them.
It's actually a hack to directly modify the 'map_start' field instead
of deleting the map entry and then readding it, because there is no
map_delete(). However, this is okay because we don't call map_add()
afterwards.
* Update the usuable LBA by fixing the 'hdr_lba_end' after expanding.
This fixes the warning revealed by the previous commit.
Bugs: #3422, #3423
Summary of changes:
sbin/gpt/expand.c | 27 ++++++++++++++++++++++++---
1 file changed, 24 insertions(+), 3 deletions(-)
http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/f6a10901992fcc728b7380721d9e5f48c97cff7a
--
DragonFly BSD source repository
More information about the Commits
mailing list