1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-02 01:18:26 +03:00

Do not allow {vg|lv}change --ignoremonitoring if on clustered VG.

clvmd does not propagate DMEVENTD_MONITOR_IGNORE.

Update get_activation_monitoring_mode() to check if the VG that the
LV is being activated in is clustered.  If so, skip it.

Any get_activation_monitoring_mode() error will cause the associated LV
(or VG) to be skipped during activation.  Both vgchange_single() and
lvchange_single(), which call get_activation_monitoring_mode(), are
called by their respective process_each_..() method.
This commit is contained in:
Mike Snitzer 2010-03-29 16:09:40 +00:00
parent c9895ac01e
commit b73c18242e
6 changed files with 17 additions and 3 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.63 - Version 2.02.63 -
================================ ================================
Do not allow {vg|lv}change --ignoremonitoring if on clustered VG.
Improved dependency tracking for dmeventd and liblvm2cmd sources. Improved dependency tracking for dmeventd and liblvm2cmd sources.
Improved Makefile rules for distclean and cflow targets. Improved Makefile rules for distclean and cflow targets.
Add ability to create mirrored logs for mirror LVs. Add ability to create mirrored logs for mirror LVs.

View File

@ -575,7 +575,7 @@ static int lvchange_single(struct cmd_context *cmd, struct logical_volume *lv,
return ECMD_FAILED; return ECMD_FAILED;
} }
if (!get_activation_monitoring_mode(cmd, &dmeventd_mode)) if (!get_activation_monitoring_mode(cmd, lv->vg, &dmeventd_mode))
return ECMD_FAILED; return ECMD_FAILED;
init_dmeventd_monitor(dmeventd_mode); init_dmeventd_monitor(dmeventd_mode);

View File

@ -484,7 +484,8 @@ static int _lvcreate_params(struct lvcreate_params *lp,
return 0; return 0;
} }
if (!get_activation_monitoring_mode(cmd, &lp->activation_monitoring)) if (!get_activation_monitoring_mode(cmd, NULL,
&lp->activation_monitoring))
return_0; return_0;
if (!_lvcreate_name_params(lp, cmd, &argc, &argv) || if (!_lvcreate_name_params(lp, cmd, &argc, &argv) ||

View File

@ -1424,6 +1424,7 @@ int pvcreate_params_validate(struct cmd_context *cmd,
} }
int get_activation_monitoring_mode(struct cmd_context *cmd, int get_activation_monitoring_mode(struct cmd_context *cmd,
struct volume_group *vg,
int *monitoring_mode) int *monitoring_mode)
{ {
*monitoring_mode = DEFAULT_DMEVENTD_MONITOR; *monitoring_mode = DEFAULT_DMEVENTD_MONITOR;
@ -1441,6 +1442,16 @@ int get_activation_monitoring_mode(struct cmd_context *cmd,
!find_config_tree_bool(cmd, "activation/monitoring", !find_config_tree_bool(cmd, "activation/monitoring",
DEFAULT_DMEVENTD_MONITOR)) DEFAULT_DMEVENTD_MONITOR))
*monitoring_mode = DMEVENTD_MONITOR_IGNORE; *monitoring_mode = DMEVENTD_MONITOR_IGNORE;
if (vg && vg_is_clustered(vg) &&
*monitoring_mode == DMEVENTD_MONITOR_IGNORE) {
log_error("%s is incompatible with clustered Volume Group "
"\"%s\": Skipping.",
(arg_count(cmd, ignoremonitoring_ARG) ?
"--ignoremonitoring" : "activation/monitoring=0"),
vg->name);
return 0;
}
return 1; return 1;
} }

View File

@ -113,6 +113,7 @@ int pvcreate_params_validate(struct cmd_context *cmd,
struct pvcreate_params *pp); struct pvcreate_params *pp);
int get_activation_monitoring_mode(struct cmd_context *cmd, int get_activation_monitoring_mode(struct cmd_context *cmd,
struct volume_group *vg,
int *monitoring_mode); int *monitoring_mode);
#endif #endif

View File

@ -529,7 +529,7 @@ static int vgchange_single(struct cmd_context *cmd, const char *vg_name,
return ECMD_FAILED; return ECMD_FAILED;
} }
if (!get_activation_monitoring_mode(cmd, &dmeventd_mode)) if (!get_activation_monitoring_mode(cmd, vg, &dmeventd_mode))
return ECMD_FAILED; return ECMD_FAILED;
init_dmeventd_monitor(dmeventd_mode); init_dmeventd_monitor(dmeventd_mode);