64 lines
2.1 KiB
Diff
64 lines
2.1 KiB
Diff
commit 5bad6200b66259dde0c1cf3bd6295e65a5ade3c9
|
|
Author: Peter Rajnoha <prajnoha@redhat.com>
|
|
Date: Tue May 14 12:57:54 2013 +0200
|
|
|
|
lvm2-2_02_99-fix-handling-of-reappeared-and-missing-pvs-in-lvmetad.patch
|
|
---
|
|
lib/cache/lvmetad.c | 8 +++++++-
|
|
lib/metadata/metadata.c | 4 ++--
|
|
lib/metadata/metadata.h | 3 +++
|
|
3 files changed, 12 insertions(+), 3 deletions(-)
|
|
|
|
diff --git a/lib/cache/lvmetad.c b/lib/cache/lvmetad.c
|
|
index a636f43..d8ad4dd 100644
|
|
--- a/lib/cache/lvmetad.c
|
|
+++ b/lib/cache/lvmetad.c
|
|
@@ -354,14 +354,20 @@ struct volume_group *lvmetad_vg_lookup(struct cmd_context *cmd, const char *vgna
|
|
if ((info = lvmcache_info_from_pvid((const char *)&pvl->pv->id, 0))) {
|
|
pvl->pv->label_sector = lvmcache_get_label(info)->sector;
|
|
pvl->pv->dev = lvmcache_device(info);
|
|
+ if (!pvl->pv->dev)
|
|
+ pvl->pv->status |= MISSING_PV;
|
|
+ else
|
|
+ check_reappeared_pv(vg, pvl->pv);
|
|
if (!lvmcache_fid_add_mdas_pv(info, fid)) {
|
|
vg = NULL;
|
|
goto_out; /* FIXME error path */
|
|
}
|
|
- } /* else probably missing */
|
|
+ } else
|
|
+ pvl->pv->status |= MISSING_PV; /* probably missing */
|
|
}
|
|
|
|
lvmcache_update_vg(vg, 0);
|
|
+ vg_mark_partial_lvs(vg, 1);
|
|
}
|
|
|
|
out:
|
|
diff --git a/lib/metadata/metadata.c b/lib/metadata/metadata.c
|
|
index c210a63..2cca93c 100644
|
|
--- a/lib/metadata/metadata.c
|
|
+++ b/lib/metadata/metadata.c
|
|
@@ -2870,8 +2870,8 @@ int vg_missing_pv_count(const struct volume_group *vg)
|
|
return ret;
|
|
}
|
|
|
|
-static void check_reappeared_pv(struct volume_group *correct_vg,
|
|
- struct physical_volume *pv)
|
|
+void check_reappeared_pv(struct volume_group *correct_vg,
|
|
+ struct physical_volume *pv)
|
|
{
|
|
struct pv_list *pvl;
|
|
|
|
diff --git a/lib/metadata/metadata.h b/lib/metadata/metadata.h
|
|
index 19bf742..630c4ca 100644
|
|
--- a/lib/metadata/metadata.h
|
|
+++ b/lib/metadata/metadata.h
|
|
@@ -492,4 +492,7 @@ int is_mirror_image_removable(struct logical_volume *mimage_lv, void *baton);
|
|
uint64_t find_min_mda_size(struct dm_list *mdas);
|
|
char *tags_format_and_copy(struct dm_pool *mem, const struct dm_list *tags);
|
|
|
|
+void check_reappeared_pv(struct volume_group *correct_vg,
|
|
+ struct physical_volume *pv);
|
|
+
|
|
#endif
|