fix renamed LV detection
authorRogier <rogier777@gmail.com>
Mon, 19 Jun 2023 15:23:25 +0000 (17:23 +0200)
committerFelix Zielcke <fzielcke@z-51.de>
Mon, 15 Jul 2024 15:05:20 +0000 (17:05 +0200)
commit5f4504911e3d713c6d54d4685db8b12eb5656a0d
treeb308b642c9888793b609babd7305c7c3552eb9b5
parentf36164ea8e22cabb9d23be9d21db3d5875032dc3
fix renamed LV detection

Origin: other
Bug: https://savannah.gnu.org/bugs/index.php?61620
Bug-Debian: https://bugs.debian.org/987008
Forwarded: https://savannah.gnu.org/bugs/index.php?61620
Reviewed-By: Antoine Beaupré
Last-Update: 2023-02-25

 It looks like the detection of the LVM logical volumes fails in
 certain edge conditions. In particular, it was reported that
 renaming an LV will make grub fail to boot from the system as it
 cannot properly detect it anymore.
 .
 I have looked at the code surrounding the patch and cannot claim to
 understand the entire function here, as it is huge and quite
 cryptic. But it seems sane: the `ptr` we're inspecting here starts
 at the `rlocn->offset`, but we were adding `mda_size` to the
 (somewhat) unrelated metadatabuf instead. Now we're marking the
 `mda_end` correctly, based on the rlocn->offsite and ->size.
 .
 I have not tested this myself as the test setup is quite involved,
 but it seems others (e.g. "Hoyer, David" <David.Hoyer@netapp.com>)
 have tested the patch and confirmed it worked.

Gbp-Pq: Name 987008-lvrename-boot-fail.patch
grub-core/disk/lvm.c