]> git.proxmox.com Git - grub2.git/blob - debian/patches/987008-lvrename-boot-fail.patch
Import changes for the 2.06-8.1 NMU
[grub2.git] / debian / patches / 987008-lvrename-boot-fail.patch
1 Description: fix renamed LV detection
2 It looks like the detection of the LVM logical volumes fails in
3 certain edge conditions. In particular, it was reported that
4 renaming an LV will make grub fail to boot from the system as it
5 cannot properly detect it anymore.
6 .
7 I have looked at the code surrounding the patch and cannot claim to
8 understand the entire function here, as it is huge and quite
9 cryptic. But it seems sane: the `ptr` we're inspecting here starts
10 at the `rlocn->offset`, but we were adding `mda_size` to the
11 (somewhat) unrelated metadatabuf instead. Now we're marking the
12 `mda_end` correctly, based on the rlocn->offsite and ->size.
13 .
14 I have not tested this myself as the test setup is quite involved,
15 but it seems others (e.g. "Hoyer, David" <David.Hoyer@netapp.com>)
16 have tested the patch and confirmed it worked.
17 Author: Rogier <rogier777@gmail.com>
18 Origin: other
19 Bug: https://savannah.gnu.org/bugs/index.php?61620
20 Bug-Debian: https://bugs.debian.org/987008
21 Forwarded: https://savannah.gnu.org/bugs/index.php?61620
22 Reviewed-By: Antoine Beaupré
23 Last-Update: 2023-02-25
24
25 --- grub2-2.06.orig/grub-core/disk/lvm.c
26 +++ grub2-2.06/grub-core/disk/lvm.c
27 @@ -290,7 +290,7 @@ grub_lvm_detect (grub_disk_t disk,
28
29 p = q = (char *)ptr;
30
31 - if (grub_add ((grub_size_t)metadatabuf, (grub_size_t)mda_size, &ptr))
32 + if (grub_add (ptr, (grub_size_t)grub_le_to_cpu64 (rlocn->size), &ptr))
33 goto error_parsing_metadata;
34
35 mda_end = (char *)ptr;