summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta-oe/recipes-support/lvm2/files/0006-start-lvm2-monitor.service-after-tmp.mount.patch16
-rw-r--r--meta-oe/recipes-support/lvm2/libdevmapper_2.03.05.bb (renamed from meta-oe/recipes-support/lvm2/libdevmapper_2.03.02.bb)2
-rw-r--r--meta-oe/recipes-support/lvm2/lvm2.inc8
-rw-r--r--meta-oe/recipes-support/lvm2/lvm2/0001-activation-add-synchronization-point.patch82
-rw-r--r--meta-oe/recipes-support/lvm2/lvm2/0002-activation-extend-handling-of-pending_delete.patch124
-rw-r--r--meta-oe/recipes-support/lvm2/lvm2/0003-snapshot-always-activate.patch40
-rw-r--r--meta-oe/recipes-support/lvm2/lvm2_2.03.05.bb (renamed from meta-oe/recipes-support/lvm2/lvm2_2.03.02.bb)5
7 files changed, 258 insertions, 19 deletions
diff --git a/meta-oe/recipes-support/lvm2/files/0006-start-lvm2-monitor.service-after-tmp.mount.patch b/meta-oe/recipes-support/lvm2/files/0006-start-lvm2-monitor.service-after-tmp.mount.patch
index e5ad4eaf2f..9f9383ef48 100644
--- a/meta-oe/recipes-support/lvm2/files/0006-start-lvm2-monitor.service-after-tmp.mount.patch
+++ b/meta-oe/recipes-support/lvm2/files/0006-start-lvm2-monitor.service-after-tmp.mount.patch
@@ -1,6 +1,6 @@
1From 24a2c47fd01dde1710f1fa66f5c30ce7010c5956 Mon Sep 17 00:00:00 2001 1From e213ed33a28704f6f538df41a91b7ce95594a4f8 Mon Sep 17 00:00:00 2001
2From: Hongxu Jia <hongxu.jia@windriver.com> 2From: Hongxu Jia <hongxu.jia@windriver.com>
3Date: Thu, 21 Sep 2017 15:28:10 +0800 3Date: Tue, 15 Oct 2019 18:12:54 +0800
4Subject: [PATCH] start lvm2-monitor.service after tmp.mount 4Subject: [PATCH] start lvm2-monitor.service after tmp.mount
5 5
6The lvm2-monitor.service reqires the existence of locking_dir 6The lvm2-monitor.service reqires the existence of locking_dir
@@ -9,18 +9,14 @@ So start lvm2-monitor.service after tmp.mount
9 9
10Upstream-Status: Inappropriate [oe specific] 10Upstream-Status: Inappropriate [oe specific]
11 11
12Rebase to v2_03_05
12Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> 13Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
13
14
15Update context for lvm2 2.03.02.
16
17Signed-off-by: Kai Kang <kai.kang@windriver.com>
18--- 14---
19 scripts/lvm2_monitoring_systemd_red_hat.service.in | 2 +- 15 scripts/lvm2_monitoring_systemd_red_hat.service.in | 2 +-
20 1 file changed, 1 insertion(+), 1 deletion(-) 16 1 file changed, 1 insertion(+), 1 deletion(-)
21 17
22diff --git a/scripts/lvm2_monitoring_systemd_red_hat.service.in b/scripts/lvm2_monitoring_systemd_red_hat.service.in 18diff --git a/scripts/lvm2_monitoring_systemd_red_hat.service.in b/scripts/lvm2_monitoring_systemd_red_hat.service.in
23index 7ec4e4e..3282a95 100644 19index 4bf744a..46766cb 100644
24--- a/scripts/lvm2_monitoring_systemd_red_hat.service.in 20--- a/scripts/lvm2_monitoring_systemd_red_hat.service.in
25+++ b/scripts/lvm2_monitoring_systemd_red_hat.service.in 21+++ b/scripts/lvm2_monitoring_systemd_red_hat.service.in
26@@ -2,7 +2,7 @@ 22@@ -2,7 +2,7 @@
@@ -29,9 +25,9 @@ index 7ec4e4e..3282a95 100644
29 Requires=dm-event.socket 25 Requires=dm-event.socket
30-After=dm-event.socket dm-event.service lvm2-activation.service 26-After=dm-event.socket dm-event.service lvm2-activation.service
31+After=dm-event.socket dm-event.service lvm2-activation.service tmp.mount 27+After=dm-event.socket dm-event.service lvm2-activation.service tmp.mount
32 Before=local-fs-pre.target 28 Before=local-fs-pre.target shutdown.target
33 DefaultDependencies=no 29 DefaultDependencies=no
34 Conflicts=shutdown.target 30 Conflicts=shutdown.target
35-- 31--
361.8.3.1 322.7.4
37 33
diff --git a/meta-oe/recipes-support/lvm2/libdevmapper_2.03.02.bb b/meta-oe/recipes-support/lvm2/libdevmapper_2.03.05.bb
index 32bc13d1b8..be558ce1d2 100644
--- a/meta-oe/recipes-support/lvm2/libdevmapper_2.03.02.bb
+++ b/meta-oe/recipes-support/lvm2/libdevmapper_2.03.05.bb
@@ -3,8 +3,6 @@
3# generates package libdevmapper 3# generates package libdevmapper
4require lvm2.inc 4require lvm2.inc
5 5
6SRCREV = "913c28917e62577a2ef67152b2e5159237503dda"
7
8DEPENDS += "autoconf-archive-native" 6DEPENDS += "autoconf-archive-native"
9 7
10TARGET_CC_ARCH += "${LDFLAGS}" 8TARGET_CC_ARCH += "${LDFLAGS}"
diff --git a/meta-oe/recipes-support/lvm2/lvm2.inc b/meta-oe/recipes-support/lvm2/lvm2.inc
index 6c95bfd02e..41bf78a3f9 100644
--- a/meta-oe/recipes-support/lvm2/lvm2.inc
+++ b/meta-oe/recipes-support/lvm2/lvm2.inc
@@ -7,7 +7,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=12713b4d9386533feeb07d6e4831765a \
7 7
8DEPENDS += "libaio" 8DEPENDS += "libaio"
9 9
10SRC_URI = "https://sourceware.org/pub/lvm2/LVM2.${PV}.tgz \ 10SRC_URI = "git://sourceware.org/git/lvm2.git \
11 file://lvm.conf \ 11 file://lvm.conf \
12 file://0001-implement-libc-specific-reopen_stream.patch \ 12 file://0001-implement-libc-specific-reopen_stream.patch \
13 file://0002-Guard-use-of-mallinfo-with-__GLIBC__.patch \ 13 file://0002-Guard-use-of-mallinfo-with-__GLIBC__.patch \
@@ -17,10 +17,8 @@ SRC_URI = "https://sourceware.org/pub/lvm2/LVM2.${PV}.tgz \
17 file://0006-start-lvm2-monitor.service-after-tmp.mount.patch \ 17 file://0006-start-lvm2-monitor.service-after-tmp.mount.patch \
18 file://0001-configure-Fix-setting-of-CLDFLAGS-default.patch \ 18 file://0001-configure-Fix-setting-of-CLDFLAGS-default.patch \
19 " 19 "
20SRC_URI[md5sum] = "5fc07da5461a3794a751dcfc355827d5" 20SRCREV = "60bd9e8406ac28a04aa5e8165149f7a5d4f3265a"
21SRC_URI[sha256sum] = "550ba750239fd75b7e52c9877565cabffef506bbf6d7f6f17b9700dee56c720f" 21S = "${WORKDIR}/git"
22
23S = "${WORKDIR}/LVM2.${PV}"
24 22
25inherit autotools-brokensep pkgconfig systemd license 23inherit autotools-brokensep pkgconfig systemd license
26 24
diff --git a/meta-oe/recipes-support/lvm2/lvm2/0001-activation-add-synchronization-point.patch b/meta-oe/recipes-support/lvm2/lvm2/0001-activation-add-synchronization-point.patch
new file mode 100644
index 0000000000..a864f1e219
--- /dev/null
+++ b/meta-oe/recipes-support/lvm2/lvm2/0001-activation-add-synchronization-point.patch
@@ -0,0 +1,82 @@
1From f8466749dd73f5b0ccf4fc86c8a7585c4140b3f9 Mon Sep 17 00:00:00 2001
2From: Zdenek Kabelac <zkabelac@redhat.com>
3Date: Fri, 16 Aug 2019 23:49:59 +0200
4Subject: [PATCH 1/3] activation: add synchronization point
5
6Resuming of 'error' table entry followed with it's dirrect removal
7is now troublesame with latest udev as it may skip processing of
8udev rules for already 'dropped' device nodes.
9
10As we cannot 'synchronize' with udev while we know we have devices
11in suspended state - rework 'cleanup' so it collects nodes
12for removal into pending_delete list and process the list with
13synchronization once we are without any suspended nodes.
14
15Upstream-Status: Backport
16Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
17---
18 WHATS_NEW | 9 +++++++++
19 lib/activate/dev_manager.c | 20 ++++++++++++--------
20 2 files changed, 21 insertions(+), 8 deletions(-)
21
22diff --git a/WHATS_NEW b/WHATS_NEW
23index 3a58de5f9..0b48e032b 100644
24--- a/WHATS_NEW
25+++ b/WHATS_NEW
26@@ -1,3 +1,12 @@
27+Version 2.03.06 -
28+================================
29+ Synchronize with udev when dropping snapshot.
30+ Add missing device synchronization point before removing pvmove node.
31+ Correctly set read_ahead for LVs when pvmove is finished.
32+ Remove unsupported OPTIONS+="event_timeout" udev rule from 11-dm-lvm.rules.
33+ Prevent creating VGs with PVs with different logical block sizes.
34+ Fix metadata writes from corrupting with large physical block size.
35+
36 Version 2.03.05 - 15th June 2019
37 ================================
38 Fix command definition for pvchange -a.
39diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c
40index 981f4674a..7101ffa12 100644
41--- a/lib/activate/dev_manager.c
42+++ b/lib/activate/dev_manager.c
43@@ -3558,13 +3558,6 @@ static int _clean_tree(struct dev_manager *dm, struct dm_tree_node *root, const
44 const char *name, *uuid;
45 struct dm_str_list *dl;
46
47- /* Deactivate any tracked pending delete nodes */
48- dm_list_iterate_items(dl, &dm->pending_delete) {
49- log_debug_activation("Deleting tracked UUID %s.", dl->str);
50- if (!dm_tree_deactivate_children(root, dl->str, strlen(dl->str)))
51- return_0;
52- }
53-
54 while ((child = dm_tree_next_child(&handle, root, 0))) {
55 if (!(name = dm_tree_node_get_name(child)))
56 continue;
57@@ -3585,10 +3578,21 @@ static int _clean_tree(struct dev_manager *dm, struct dm_tree_node *root, const
58 if (non_toplevel_tree_dlid && !strcmp(non_toplevel_tree_dlid, uuid))
59 continue;
60
61- if (!dm_tree_deactivate_children(root, uuid, strlen(uuid)))
62+ if (!str_list_add(dm->mem, &dm->pending_delete, uuid))
63 return_0;
64 }
65
66+ /* Deactivate any tracked pending delete nodes */
67+ if (!dm_list_empty(&dm->pending_delete) && !dm_get_suspended_counter()) {
68+ fs_unlock();
69+ dm_tree_set_cookie(root, fs_get_cookie());
70+ dm_list_iterate_items(dl, &dm->pending_delete) {
71+ log_debug_activation("Deleting tracked UUID %s.", dl->str);
72+ if (!dm_tree_deactivate_children(root, dl->str, strlen(dl->str)))
73+ return_0;
74+ }
75+ }
76+
77 return 1;
78 }
79
80--
812.21.0
82
diff --git a/meta-oe/recipes-support/lvm2/lvm2/0002-activation-extend-handling-of-pending_delete.patch b/meta-oe/recipes-support/lvm2/lvm2/0002-activation-extend-handling-of-pending_delete.patch
new file mode 100644
index 0000000000..e30731593b
--- /dev/null
+++ b/meta-oe/recipes-support/lvm2/lvm2/0002-activation-extend-handling-of-pending_delete.patch
@@ -0,0 +1,124 @@
1From d06ad77b47f4dfd25bc3da88c0621ac073ad8ce5 Mon Sep 17 00:00:00 2001
2From: Zdenek Kabelac <zkabelac@redhat.com>
3Date: Fri, 23 Aug 2019 13:08:34 +0200
4Subject: [PATCH 2/3] activation: extend handling of pending_delete
5
6With previous patch 30a98e4d6710a543692d40d11428ae4baea11b7b we
7started to put devices one pending_delete list instead
8of directly scheduling their removal.
9
10However we have operations like 'snapshot merge' where we are
11resuming device tree in 2 subsequent activation calls - so
121st such call will still have suspened devices and no chance
13to push 'remove' ioctl.
14
15Since we curently cannot easily solve this by doing just single
16activation call (which would be preferred solution) - we introduce
17a preservation of pending_delete via command structure and
18then restore it on next activation call.
19
20This way we keep to remove devices later - although it might be
21not the best moment - this may need futher tunning.
22
23Also we don't keep the list of operation in 1 trasaction
24(unless we do verify udev symlinks) - this could probably
25also make it more correct in terms of which 'remove' can
26be combined we already running 'resume'.
27
28Upstream-Status: Backport
29Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
30---
31 lib/activate/dev_manager.c | 24 +++++++++++-------------
32 lib/commands/toolcontext.c | 8 ++++++++
33 lib/commands/toolcontext.h | 1 +
34 3 files changed, 20 insertions(+), 13 deletions(-)
35
36diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c
37index 7101ffa12..7a7689291 100644
38--- a/lib/activate/dev_manager.c
39+++ b/lib/activate/dev_manager.c
40@@ -3591,6 +3591,7 @@ static int _clean_tree(struct dev_manager *dm, struct dm_tree_node *root, const
41 if (!dm_tree_deactivate_children(root, dl->str, strlen(dl->str)))
42 return_0;
43 }
44+ dm_list_init(&dm->pending_delete);
45 }
46
47 return 1;
48@@ -3717,25 +3718,22 @@ out_no_root:
49 int dev_manager_activate(struct dev_manager *dm, const struct logical_volume *lv,
50 struct lv_activate_opts *laopts)
51 {
52+ dm_list_splice(&dm->pending_delete, &lv->vg->cmd->pending_delete);
53+
54 if (!_tree_action(dm, lv, laopts, ACTIVATE))
55 return_0;
56
57- /*
58- * When lvm2 resumes a device and shortly after that it removes it,
59- * udevd rule will try to blindly call 'dmsetup info' on already removed
60- * device leaving the trace inside syslog about failing operation.
61- *
62- * TODO: It's not completely clear this call here is the best fix.
63- * Maybe there can be a better sequence, but ATM we do usually resume
64- * error device i.e. on cache deletion and remove it.
65- * TODO2: there could be more similar cases!
66- */
67- if (!dm_list_empty(&dm->pending_delete))
68- fs_unlock();
69-
70 if (!_tree_action(dm, lv, laopts, CLEAN))
71 return_0;
72
73+ if (!dm_list_empty(&dm->pending_delete)) {
74+ log_debug("Preserving %d device(s) for removal while being suspended.",
75+ dm_list_size(&dm->pending_delete));
76+ if (!(str_list_dup(lv->vg->cmd->mem, &lv->vg->cmd->pending_delete,
77+ &dm->pending_delete)))
78+ return_0;
79+ }
80+
81 return 1;
82 }
83
84diff --git a/lib/commands/toolcontext.c b/lib/commands/toolcontext.c
85index 1e03ea235..0a9355361 100644
86--- a/lib/commands/toolcontext.c
87+++ b/lib/commands/toolcontext.c
88@@ -1734,6 +1734,8 @@ struct cmd_context *create_toolcontext(unsigned is_clvmd,
89 cmd->current_settings = cmd->default_settings;
90
91 cmd->initialized.config = 1;
92+
93+ dm_list_init(&cmd->pending_delete);
94 out:
95 if (!cmd->initialized.config) {
96 destroy_toolcontext(cmd);
97@@ -1922,6 +1924,12 @@ int refresh_toolcontext(struct cmd_context *cmd)
98
99 cmd->initialized.config = 1;
100
101+ if (!dm_list_empty(&cmd->pending_delete)) {
102+ log_debug(INTERNAL_ERROR "Unprocessed pending delete for %d devices.",
103+ dm_list_size(&cmd->pending_delete));
104+ dm_list_init(&cmd->pending_delete);
105+ }
106+
107 if (cmd->initialized.connections && !init_connections(cmd))
108 return_0;
109
110diff --git a/lib/commands/toolcontext.h b/lib/commands/toolcontext.h
111index 6e4530c8a..54ddec320 100644
112--- a/lib/commands/toolcontext.h
113+++ b/lib/commands/toolcontext.h
114@@ -237,6 +237,7 @@ struct cmd_context {
115 const char *report_list_item_separator;
116 const char *time_format;
117 unsigned rand_seed;
118+ struct dm_list pending_delete; /* list of LVs for removal */
119 };
120
121 /*
122--
1232.21.0
124
diff --git a/meta-oe/recipes-support/lvm2/lvm2/0003-snapshot-always-activate.patch b/meta-oe/recipes-support/lvm2/lvm2/0003-snapshot-always-activate.patch
new file mode 100644
index 0000000000..953e4ad659
--- /dev/null
+++ b/meta-oe/recipes-support/lvm2/lvm2/0003-snapshot-always-activate.patch
@@ -0,0 +1,40 @@
1From 9143445478871b47ba28b41f5e88d4c415f8205b Mon Sep 17 00:00:00 2001
2From: Zdenek Kabelac <zkabelac@redhat.com>
3Date: Mon, 26 Aug 2019 15:13:55 +0200
4Subject: [PATCH 3/3] snapshot: always activate
5
6Drop the 'cluster-only' optimization so we do resume ALL device
7before we try to wait on cookie before 'removal' operation.
8
9It's more correct order of operation - alhtough possibly slightly
10less efficient - but until we have correct list of operations
11'in-progress' we can't do anything better.
12
13Upstream-Status: Backport
14Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
15---
16 lib/metadata/snapshot_manip.c | 8 +-------
17 1 file changed, 1 insertion(+), 7 deletions(-)
18
19diff --git a/lib/metadata/snapshot_manip.c b/lib/metadata/snapshot_manip.c
20index 5ccf251c7..65d8dbd13 100644
21--- a/lib/metadata/snapshot_manip.c
22+++ b/lib/metadata/snapshot_manip.c
23@@ -361,13 +361,7 @@ int vg_remove_snapshot(struct logical_volume *cow)
24 return 0;
25 }
26
27- /*
28- * For merged snapshot and clustered VG activate cow LV so
29- * the following call to deactivate_lv() can clean-up table
30- * entries. For this clustered lock need to be held.
31- */
32- if (vg_is_clustered(cow->vg) &&
33- merging_snapshot && !activate_lv(cow->vg->cmd, cow)) {
34+ if (merging_snapshot && !activate_lv(cow->vg->cmd, cow)) {
35 log_error("Failed to activate %s.", cow->name);
36 return 0;
37 }
38--
392.21.0
40
diff --git a/meta-oe/recipes-support/lvm2/lvm2_2.03.02.bb b/meta-oe/recipes-support/lvm2/lvm2_2.03.05.bb
index 875709cd90..b80f1fd4bb 100644
--- a/meta-oe/recipes-support/lvm2/lvm2_2.03.02.bb
+++ b/meta-oe/recipes-support/lvm2/lvm2_2.03.05.bb
@@ -1,11 +1,12 @@
1require lvm2.inc 1require lvm2.inc
2 2
3SRCREV = "913c28917e62577a2ef67152b2e5159237503dda"
4
5SRC_URI += " \ 3SRC_URI += " \
6 file://0001-dev-hdc-open-failed-No-medium-found-will-print-out-i.patch \ 4 file://0001-dev-hdc-open-failed-No-medium-found-will-print-out-i.patch \
7 file://0001-fix-command-bin-findmnt-bin-lsblk-bin-sort-not-found.patch \ 5 file://0001-fix-command-bin-findmnt-bin-lsblk-bin-sort-not-found.patch \
8 file://0001-udev-remove-unsupported-OPTIONS-event_timeout-rule.patch \ 6 file://0001-udev-remove-unsupported-OPTIONS-event_timeout-rule.patch \
7 file://0001-activation-add-synchronization-point.patch \
8 file://0002-activation-extend-handling-of-pending_delete.patch \
9 file://0003-snapshot-always-activate.patch \
9 " 10 "
10 11
11DEPENDS += "autoconf-archive-native" 12DEPENDS += "autoconf-archive-native"