diff options
author | Li Zhou <li.zhou@windriver.com> | 2015-05-26 10:59:23 +0800 |
---|---|---|
committer | Martin Jansa <Martin.Jansa@gmail.com> | 2015-05-28 10:35:16 +0200 |
commit | f7f2657dac50d9cf80411cf05c35fb76219a4044 (patch) | |
tree | b30d0f3f9f53ef96215be4b54a7ad41a1827e604 /meta-oe | |
parent | 47ca7a840302a6b4c59c6b1689559de7bdbf9c6b (diff) | |
download | meta-openembedded-f7f2657dac50d9cf80411cf05c35fb76219a4044.tar.gz |
lvm2: fix segfault for snapshot
Backport <commit c46d4a745dc8c5cb4cfc0c94863e555387e9af75> from lvm2
upstream <https://git.fedorahosted.org/git/lvm2.git> to solve issue:
vgchange segfault in lv_is_merging_cow function.
Signed-off-by: Li Zhou <li.zhou@windriver.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'meta-oe')
-rw-r--r-- | meta-oe/recipes-support/lvm2/lvm2.inc | 3 | ||||
-rw-r--r-- | meta-oe/recipes-support/lvm2/lvm2/0001-snapshot-check-snapshot-exists.patch | 29 |
2 files changed, 31 insertions, 1 deletions
diff --git a/meta-oe/recipes-support/lvm2/lvm2.inc b/meta-oe/recipes-support/lvm2/lvm2.inc index 42f6e3a43..e116629f8 100644 --- a/meta-oe/recipes-support/lvm2/lvm2.inc +++ b/meta-oe/recipes-support/lvm2/lvm2.inc | |||
@@ -11,7 +11,8 @@ S = "${WORKDIR}/LVM2.${PV}" | |||
11 | SRC_URI = "ftp://sources.redhat.com/pub/lvm2/old/LVM2.${PV}.tgz \ | 11 | SRC_URI = "ftp://sources.redhat.com/pub/lvm2/old/LVM2.${PV}.tgz \ |
12 | file://0001-Replace-CPPFunction-with-rl_completion_func_t.patch \ | 12 | file://0001-Replace-CPPFunction-with-rl_completion_func_t.patch \ |
13 | file://mlock-ignore-vectors-gate_vma.patch \ | 13 | file://mlock-ignore-vectors-gate_vma.patch \ |
14 | file://lvm.conf" | 14 | file://lvm.conf \ |
15 | file://0001-snapshot-check-snapshot-exists.patch" | ||
15 | 16 | ||
16 | PACKAGECONFIG ??= "readline" | 17 | PACKAGECONFIG ??= "readline" |
17 | PACKAGECONFIG[readline] = "--enable-readline,--disable-readline,readline" | 18 | PACKAGECONFIG[readline] = "--enable-readline,--disable-readline,readline" |
diff --git a/meta-oe/recipes-support/lvm2/lvm2/0001-snapshot-check-snapshot-exists.patch b/meta-oe/recipes-support/lvm2/lvm2/0001-snapshot-check-snapshot-exists.patch new file mode 100644 index 000000000..8f0da796d --- /dev/null +++ b/meta-oe/recipes-support/lvm2/lvm2/0001-snapshot-check-snapshot-exists.patch | |||
@@ -0,0 +1,29 @@ | |||
1 | From c46d4a745dc8c5cb4cfc0c94863e555387e9af75 Mon Sep 17 00:00:00 2001 | ||
2 | From: Zdenek Kabelac <zkabelac@redhat.com> | ||
3 | Date: Mon, 16 Jun 2014 12:41:30 +0200 | ||
4 | Subject: [PATCH] snapshot: check snapshot exists | ||
5 | |||
6 | Return 0 if the LV is not even snapshot. | ||
7 | |||
8 | Upstream-Status: backport | ||
9 | Adapt the patch for backporting to an older version. | ||
10 | Signed-off-by: Li Zhou <li.zhou@windriver.com> | ||
11 | --- | ||
12 | lib/metadata/snapshot_manip.c | 3 ++- | ||
13 | 1 file changed, 2 insertions(+), 1 deletion(-) | ||
14 | |||
15 | Index: LVM2.2.02.97/lib/metadata/snapshot_manip.c | ||
16 | =================================================================== | ||
17 | --- LVM2.2.02.97.orig/lib/metadata/snapshot_manip.c | ||
18 | +++ LVM2.2.02.97/lib/metadata/snapshot_manip.c | ||
19 | @@ -68,8 +68,9 @@ struct lv_segment *find_merging_cow(cons | ||
20 | |||
21 | int lv_is_merging_cow(const struct logical_volume *snapshot) | ||
22 | { | ||
23 | + struct lv_segment *snap_seg = find_cow(snapshot); | ||
24 | /* checks lv_segment's status to see if cow is merging */ | ||
25 | - return (find_cow(snapshot)->status & MERGING) ? 1 : 0; | ||
26 | + return (snap_seg && (snap_seg->status & MERGING)) ? 1 : 0; | ||
27 | } | ||
28 | |||
29 | /* Given a cow LV, return the snapshot lv_segment that uses it */ | ||