diff --git a/lib/locking/locking.h b/lib/locking/locking.h index f6a385953..23636fc8d 100644 --- a/lib/locking/locking.h +++ b/lib/locking/locking.h @@ -138,7 +138,6 @@ int check_lvm1_vg_inactive(struct cmd_context *cmd, const char *vgname); #define LCK_VG_READ (LCK_VG | LCK_READ | LCK_HOLD) #define LCK_VG_WRITE (LCK_VG | LCK_WRITE | LCK_HOLD) #define LCK_VG_UNLOCK (LCK_VG | LCK_UNLOCK) -#define LCK_VG_DROP_CACHE (LCK_VG | LCK_WRITE | LCK_CACHE) /* FIXME: LCK_HOLD abused here */ #define LCK_VG_COMMIT (LCK_VG | LCK_WRITE | LCK_CACHE | LCK_HOLD) @@ -163,9 +162,6 @@ int check_lvm1_vg_inactive(struct cmd_context *cmd, const char *vgname); release_vg(vg); \ } while (0) -#define drop_cached_metadata(vg) \ - lock_vol((vg)->cmd, (vg)->name, LCK_VG_DROP_CACHE, NULL) - int sync_local_dev_names(struct cmd_context* cmd); /* Process list of LVs */ diff --git a/lib/metadata/metadata.c b/lib/metadata/metadata.c index b7a73c52d..e45f5c12c 100644 --- a/lib/metadata/metadata.c +++ b/lib/metadata/metadata.c @@ -2915,11 +2915,6 @@ int vg_write(struct volume_group *vg) return 0; } - if (!drop_cached_metadata(vg)) { - log_error("Unable to drop cached metadata for VG %s.", vg->name); - return 0; - } - if (critical_section()) log_error(INTERNAL_ERROR "Writing metadata in critical section."); @@ -3077,11 +3072,6 @@ int vg_commit(struct volume_group *vg) _vg_move_cached_precommitted_to_committed(vg); } - /* If update failed, remove any cached precommitted metadata. */ - if (!cache_updated && !drop_cached_metadata(vg)) - log_error("Attempt to drop cached metadata failed " - "after commit for VG %s.", vg->name); - /* If at least one mda commit succeeded, it was committed */ return cache_updated; } @@ -3115,10 +3105,6 @@ void vg_revert(struct volume_group *vg) stack; } } - - if (!drop_cached_metadata(vg)) - log_error("Attempt to drop cached metadata failed " - "after reverted update for VG %s.", vg->name); } static int _check_mda_in_use(struct metadata_area *mda, void *_in_use) @@ -3543,12 +3529,6 @@ static int _wipe_outdated_pvs(struct cmd_context *cmd, struct volume_group *vg, pv_dev_name(pvl->pv), uuid, vg->name); if (!pv_write_orphan(cmd, pvl->pv)) return_0; - - /* Refresh metadata after orphan write */ - if (!drop_cached_metadata(vg)) { - log_error("Unable to drop cached metadata for VG %s while wiping outdated PVs.", vg->name); - return 0; - } next_pv: ; } diff --git a/tools/vgmerge.c b/tools/vgmerge.c index 920ed73c5..eab3d56f6 100644 --- a/tools/vgmerge.c +++ b/tools/vgmerge.c @@ -103,9 +103,6 @@ static int _vgmerge_single(struct cmd_context *cmd, const char *vg_name_to, if (!archive(vg_from) || !archive(vg_to)) goto_bad; - if (!drop_cached_metadata(vg_from)) - stack; - if (!_vgmerge_select_pool_metadata_spare(cmd, vg_to, vg_from)) goto_bad; diff --git a/tools/vgrename.c b/tools/vgrename.c index bbc30870d..2e6157f37 100644 --- a/tools/vgrename.c +++ b/tools/vgrename.c @@ -108,10 +108,6 @@ static int _vgrename_single(struct cmd_context *cmd, const char *vg_name, if (!archive(vg)) goto error; - /* Remove references based on old name */ - if (!drop_cached_metadata(vg)) - stack; - if (!lockd_rename_vg_before(cmd, vg)) { stack; goto error;