summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2023-02-02 16:15:13 -0600
committerDavid Teigland <teigland@redhat.com>2023-02-02 16:15:13 -0600
commit57ad78d4369ee531ab0173b42aa91048eb316353 (patch)
treea2723a96f43b8ba0788654e589576e6c6116040b /lib
parent8498874147c886032817c24d11231947a041bc2e (diff)
downloadlvm2-57ad78d4369ee531ab0173b42aa91048eb316353.tar.gz
vg_read: remove unused code for md components
This code was no longer used after ommit 87ee401eea3c3c3958ec5cda6e5c246b80503b8c
Diffstat (limited to 'lib')
-rw-r--r--lib/metadata/metadata.c44
1 files changed, 1 insertions, 43 deletions
diff --git a/lib/metadata/metadata.c b/lib/metadata/metadata.c
index 30b2c1779..91a23f931 100644
--- a/lib/metadata/metadata.c
+++ b/lib/metadata/metadata.c
@@ -4643,11 +4643,9 @@ static struct volume_group *_vg_read(struct cmd_context *cmd,
struct volume_group *vg, *vg_ret = NULL;
struct metadata_area *mda, *mda2;
unsigned use_precommitted = precommitted;
- struct device *mda_dev, *dev_ret = NULL, *dev;
+ struct device *mda_dev, *dev_ret = NULL;
struct cached_vg_fmtdata *vg_fmtdata = NULL; /* Additional format-specific data about the vg */
- struct pv_list *pvl;
int found_old_metadata = 0;
- int found_md_component = 0;
unsigned use_previous_vg;
log_debug_metadata("Reading VG %s %s", vgname ?: "<no name>", vgid ?: "<no vgid>");
@@ -4867,46 +4865,6 @@ static struct volume_group *_vg_read(struct cmd_context *cmd,
}
/*
- * Usually md components are eliminated during label scan, or duplicate
- * resolution, but sometimes an md component can get through and be
- * detected in set_pv_device() (which will do an md component check if
- * the device/PV sizes don't match.) In this case we need to fix up
- * lvmcache to drop the component dev and fix up metadata_areas_in_use
- * to drop it also.
- */
- if (found_md_component) {
- dm_list_iterate_items(pvl, &vg_ret->pvs) {
- if (!(dev = lvmcache_device_from_pv_id(cmd, &pvl->pv->id, NULL)))
- continue;
-
- /* dev_is_md_component set this flag if it was found */
- if (!(dev->flags & DEV_IS_MD_COMPONENT))
- continue;
-
- log_debug_metadata("Drop dev for MD component from cache %s.", dev_name(dev));
- lvmcache_del_dev(dev);
-
- dm_list_iterate_items(mda, &fid->metadata_areas_in_use)
- if (mda_get_device(mda) == dev) {
- log_debug_metadata("Drop mda from MD component from mda list %s.", dev_name(dev));
- dm_list_del(&mda->list);
- break;
- }
- }
- }
-
- /*
- * After dropping MD components there may be no remaining legitimate
- * devices for this VG.
- */
- if (!lvmcache_vginfo_from_vgid(vgid)) {
- log_debug_metadata("VG %s not found on any remaining devices.", vgname);
- release_vg(vg_ret);
- vg_ret = NULL;
- goto out;
- }
-
- /*
* Correct the lvmcache representation of the VG using the metadata
* that we have chosen above (vg_ret).
*