mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-03 05:18:29 +03:00
Make vg_mark_partial_lvs also clear existing PARTIAL_LV flags, so it can be
issued repeatedly on the same VG, keeping the PARTIAL_LV flags up to date.
This commit is contained in:
parent
5510b4e7d7
commit
833a287337
@ -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;
|
||||
|
@ -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()) {
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user