diff --git a/daemons/clvmd/lvm-functions.c b/daemons/clvmd/lvm-functions.c index 6254122ee..7e7b992ee 100644 --- a/daemons/clvmd/lvm-functions.c +++ b/daemons/clvmd/lvm-functions.c @@ -913,6 +913,7 @@ int init_clvm(struct dm_hash_table *excl_uuid) return 0; } + cmd->is_clvmd = 1; cmd->cmd_line = "clvmd"; /* Check lvm.conf is setup for cluster-LVM */ diff --git a/lib/activate/activate.c b/lib/activate/activate.c index eb04ef023..8e79cf549 100644 --- a/lib/activate/activate.c +++ b/lib/activate/activate.c @@ -2154,6 +2154,9 @@ static int _lv_suspend(struct cmd_context *cmd, const char *lvid_s, if (!activation()) return 1; + if (!cmd->is_clvmd) + goto skip_read; + if (lv && lv_pre) goto skip_read; @@ -2223,8 +2226,10 @@ skip_read: * did happen (or failed), and it will resume LVs using the * new/precommitted metadata if the vg_commit succeeded. */ - lvmcache_save_vg(lv->vg, 0); - lvmcache_save_vg(lv_pre->vg, 1); + if (cmd->is_clvmd) { + lvmcache_save_vg(lv->vg, 0); + lvmcache_save_vg(lv_pre->vg, 1); + } if (!info.exists || info.suspended) { if (!error_if_not_suspended) { diff --git a/lib/cache/lvmcache.c b/lib/cache/lvmcache.c index 4a7b6f928..7534567f6 100644 --- a/lib/cache/lvmcache.c +++ b/lib/cache/lvmcache.c @@ -246,8 +246,6 @@ static void _drop_metadata(const char *vgname, int drop_precommitted) if (!(vginfo = lvmcache_vginfo_from_vgname(vgname, NULL))) return; - log_debug_cache("lvmcache: dropping saved_vg %s pre %d", vgname, drop_precommitted); - if (drop_precommitted) _saved_vg_free(vginfo, 0, 1); else diff --git a/lib/commands/toolcontext.h b/lib/commands/toolcontext.h index 24742641c..1d9de0a7a 100644 --- a/lib/commands/toolcontext.h +++ b/lib/commands/toolcontext.h @@ -170,6 +170,7 @@ struct cmd_context { unsigned mirror_warn_printed:1; /* command already printed warning about non-monitored mirrors */ unsigned pvscan_cache_single:1; unsigned can_use_one_scan:1; + unsigned is_clvmd:1; /* * Filtering.