lvm2/bug-1185190_01-pvscan-support-disabled-event_activation.patch
Gang He b226ee2e0d Accepting request 887913 from home:hmzhao:branches:openSUSE:Factory
- Honor lvm.conf event_activation=0 on "pvscan --cache -aay" (bsc#1185190)
  + bug-1185190_01-pvscan-support-disabled-event_activation.patch
  + bug-1185190_02-config-improve-description-for-event_activation.patch

OBS-URL: https://build.opensuse.org/request/show/887913
OBS-URL: https://build.opensuse.org/package/show/Base:System/lvm2?expand=0&rev=296
2021-04-23 05:24:21 +00:00

40 lines
1.2 KiB
Diff

From 2be585b79c71b8f70c0252af5f09dbd5e6103030 Mon Sep 17 00:00:00 2001
From: Zdenek Kabelac <zkabelac@redhat.com>
Date: Mon, 8 Feb 2021 16:28:18 +0100
Subject: [PATCH] pvscan: support disabled event_activation
In past we had this control with use_lvmetad check for
pvscan --cache -aay
Howerer this got lost with lvmetad removal commit:
117160b27e510dceb1ed6acf995115c040acd88d
When user sets lvm.conf global/event_activation=0
pvscan service will no longer auto activate any LVs on appeared PVs.
Signed-off-by: Heming Zhao <heming.zhao@suse.com>
---
tools/pvscan.c | 6 ++++++
1 file changed, 6 insertions(+)
diff -Nupr a/tools/pvscan.c b/tools/pvscan.c
--- a/tools/pvscan.c 2021-04-23 11:12:35.352431602 +0800
+++ b/tools/pvscan.c 2021-04-23 11:18:29.194565976 +0800
@@ -1224,6 +1224,12 @@ int pvscan_cache_cmd(struct cmd_context
dm_list_init(&vgnames);
dm_list_init(&vglist);
+ if (do_activate &&
+ !find_config_tree_bool(cmd, global_event_activation_CFG, NULL)) {
+ log_verbose("Ignoring pvscan --cache -aay because event_activation is disabled.");
+ return ECMD_PROCESSED;
+ }
+
/*
* When systemd/udev run pvscan --cache commands, those commands
* should not wait on udev info since the udev info may not be
--
2.16.4