From f3c90e90f8466b5c2fe336e9a1947307c92c9e59 Mon Sep 17 00:00:00 2001 From: David Teigland Date: Fri, 26 May 2017 13:26:09 -0500 Subject: [PATCH] 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. --- WHATS_NEW | 1 + lib/metadata/metadata.c | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) 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; }