From d6df31fba1dede4df890d771a0f0c3e74546e4be Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Sun, 7 Apr 2024 13:01:26 +0200 Subject: [PATCH] pools: no checking for lv/vgremove deactivation Thin-pool and cache-pool targets got already quite stable so let's try to remove checking of pools when using lvremove or vgremove commands. This skips checking pools when they are going to be removed, but it also when removing thin volume that was the only user of a thin-pool. In this case thin-pool will be still there and could be activated again with another thin volume and thin_check will be executed in this moment. In this case it can delay discovery of metadata damage. --- lib/activate/dev_manager.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c index 456130e1d..c1a32a112 100644 --- a/lib/activate/dev_manager.c +++ b/lib/activate/dev_manager.c @@ -2649,6 +2649,14 @@ static int _pool_register_callback(struct dev_manager *dm, pool_has_message(first_seg(lv), NULL, 0)))) return 1; #endif + /* Skip validation of metadata for lvremove and vgremove */ + if (!dm->activation && + (!strcmp(dm->cmd->name, "lvremove") || + !strcmp(dm->cmd->name, "vgremove"))) { + log_debug("Skipping %s callback registration for command %s.", + display_lvname(lv), dm->cmd->name); + return 1; + } if (!(data = dm_pool_zalloc(dm->mem, sizeof(*data)))) { log_error("Failed to allocated path for callback.");