]> sourceware.org Git - lvm2.git/commitdiff
Make vg_mark_partial_lvs also clear existing PARTIAL_LV flags, so it can be
authorPetr Rockai <prockai@redhat.com>
Sat, 7 May 2011 13:32:05 +0000 (13:32 +0000)
committerPetr Rockai <prockai@redhat.com>
Sat, 7 May 2011 13:32:05 +0000 (13:32 +0000)
issued repeatedly on the same VG, keeping the PARTIAL_LV flags up to date.

lib/metadata/metadata-exported.h
lib/metadata/metadata.c
lib/metadata/metadata.h
lib/mirror/mirrored.c

index 331dd74af802e955b0929d3c43d92244121b3861..155eb7dc0338e5af597cabe8859feec58829b9a9 100644 (file)
@@ -763,6 +763,8 @@ int vg_check_write_mode(struct volume_group *vg);
 int lv_has_unknown_segments(const struct logical_volume *lv);
 int vg_has_unknown_segments(const struct volume_group *vg);
 
+int vg_mark_partial_lvs(struct volume_group *vg, int clear);
+
 struct vgcreate_params {
        const char *vg_name;
        uint32_t extent_size;
index 9668102f22b71b0f51b1f1fcba07fd5973d12264..756ed6044aca090e10d753b90fdf7840e7879737 100644 (file)
@@ -2138,11 +2138,16 @@ static int _lv_mark_if_partial_single(struct logical_volume *lv, void *data)
  * propagated transitively, so LVs referencing other LVs are marked
  * partial as well, if any of their referenced LVs are marked partial.
  */
-int vg_mark_partial_lvs(struct volume_group *vg)
+int vg_mark_partial_lvs(struct volume_group *vg, int clear)
 {
+       struct lv_list *lvl;
+
+       if (clear)
+               dm_list_iterate_items(lvl, &vg->lvs)
+                       lvl->lv->status &= ~PARTIAL_LV;
+
        if (!_lv_postorder_vg(vg, _lv_mark_if_partial_single, NULL))
                return_0;
-
        return 1;
 }
 
@@ -2825,7 +2830,7 @@ static struct volume_group *_vg_read(struct cmd_context *cmd,
                if (vg_missing_pv_count(correct_vg)) {
                        log_verbose("There are %d physical volumes missing.",
                                    vg_missing_pv_count(correct_vg));
-                       vg_mark_partial_lvs(correct_vg);
+                       vg_mark_partial_lvs(correct_vg, 1);
                }
                return correct_vg;
        } else {
@@ -3179,7 +3184,7 @@ static struct volume_group *_vg_read(struct cmd_context *cmd,
        if (vg_missing_pv_count(correct_vg)) {
                log_verbose("There are %d physical volumes missing.",
                            vg_missing_pv_count(correct_vg));
-               vg_mark_partial_lvs(correct_vg);
+               vg_mark_partial_lvs(correct_vg, 1);
        }
 
        if ((correct_vg->status & PVMOVE) && !pvmove_mode()) {
index e6b16b2cf18e1a211af86da330a0268800096f4f..4b298832a83958dc74e72792ed182faac59929bd 100644 (file)
@@ -471,7 +471,6 @@ struct id pv_vgid(const struct physical_volume *pv);
 struct physical_volume *pv_by_path(struct cmd_context *cmd, const char *pv_name);
 int add_pv_to_vg(struct volume_group *vg, const char *pv_name,
                 struct physical_volume *pv);
-int vg_mark_partial_lvs(struct volume_group *vg);
 int is_mirror_image_removable(struct logical_volume *mimage_lv, void *baton);
 
 uint64_t find_min_mda_size(struct dm_list *mdas);
index be9e540f7ffca3c3f874e1a3c25f5f74abdb281e..4c74a4424ac587e2f7c1c8298382e10046ddc6a0 100644 (file)
@@ -343,7 +343,7 @@ static int _mirrored_transient_status(struct lv_segment *seg, char *params)
 
        /* update PARTIAL_LV flags across the VG */
        if (failed)
-               vg_mark_partial_lvs(lv->vg);
+               vg_mark_partial_lvs(lv->vg, 0);
 
        return 1;
 }
This page took 0.046578 seconds and 5 git commands to generate.