summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2017-05-26 13:26:09 -0500
committerDavid Teigland <teigland@redhat.com>2017-06-01 09:53:14 -0500
commitf3c90e90f8466b5c2fe336e9a1947307c92c9e59 (patch)
treecc9b53d688f99727494309e3b8ea16967e537857
parent743ffb1962ef272e5023c1ac652c5bcde86ff5fd (diff)
downloadlvm2-f3c90e90f8466b5c2fe336e9a1947307c92c9e59.tar.gz
disable repairing in-use flag on orphan PVs
A PV holding VG metadata that lvm can't understand (e.g. damaged, checksum error, unrecognized flag) will appear as an in-use orphan, and will be cleared by this repair code. Disable this repair until the code can keep track of these problematic PVs, and distinguish them from actual in-use orphans.
-rw-r--r--WHATS_NEW1
-rw-r--r--lib/metadata/metadata.c17
2 files changed, 18 insertions, 0 deletions
diff --git a/WHATS_NEW b/WHATS_NEW
index 878aa7a99..10d845f7b 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.172 -
===============================
+ Disable automatic clearing of PVs that look like in-use orphans.
Cache format2 flag is now using segment name type field.
Support storing status flags via segtype name field.
Stop using '--yes' mode when fsadm runs without terminal.
diff --git a/lib/metadata/metadata.c b/lib/metadata/metadata.c
index c5a41fe63..cb02ecfdd 100644
--- a/lib/metadata/metadata.c
+++ b/lib/metadata/metadata.c
@@ -3741,6 +3741,7 @@ struct _vg_read_orphan_baton {
* by pvcreate, and are displayed with a special flag by 'pvs'.
*/
+#if 0
static int _check_or_repair_orphan_pv_ext(struct physical_volume *pv,
struct lvmcache_info *info,
struct _vg_read_orphan_baton *b)
@@ -3794,6 +3795,7 @@ static int _check_or_repair_orphan_pv_ext(struct physical_volume *pv,
return 1;
}
+#endif
static int _vg_read_orphan_pv(struct lvmcache_info *info, void *baton)
{
@@ -3815,10 +3817,25 @@ static int _vg_read_orphan_pv(struct lvmcache_info *info, void *baton)
pvl->pv = pv;
add_pvl_to_vgs(b->vg, pvl);
+ /*
+ * FIXME: this bit of code that does the auto repair is disabled
+ * until we can distinguish cases where the repair should not
+ * happen, i.e. the VG metadata could not be read/parsed.
+ *
+ * A PV holding VG metadata that lvm can't understand
+ * (e.g. damaged, checksum error, unrecognized flag)
+ * will appear as an in-use orphan, and would be cleared
+ * by this repair code. Disable this repair until the
+ * code can keep track of these problematic PVs, and
+ * distinguish them from actual in-use orphans.
+ */
+
+ /*
if (!_check_or_repair_orphan_pv_ext(pv, info, baton)) {
stack;
return 0;
}
+ */
return 1;
}