1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-10 05:18:36 +03:00

Fix clvmd to respect DMEVENTD_MONITOR_IGNORE. Fixes a bug where dmeventd

actions caused clvmd to turn off monitoring of the volume causing the action.
This commit is contained in:
Petr Rockai 2011-11-30 17:00:57 +00:00
parent 204aaf2253
commit 7dd63d8ff2
3 changed files with 16 additions and 7 deletions

View File

@ -132,13 +132,14 @@ static const char *decode_flags(unsigned char flags)
static char buf[128];
int len;
len = sprintf(buf, "0x%x ( %s%s%s%s%s%s)", flags,
len = sprintf(buf, "0x%x ( %s%s%s%s%s%s%s)", flags,
flags & LCK_PARTIAL_MODE ? "PARTIAL_MODE|" : "",
flags & LCK_MIRROR_NOSYNC_MODE ? "MIRROR_NOSYNC|" : "",
flags & LCK_DMEVENTD_MONITOR_MODE ? "DMEVENTD_MONITOR|" : "",
flags & LCK_ORIGIN_ONLY_MODE ? "ORIGIN_ONLY|" : "",
flags & LCK_TEST_MODE ? "TEST|" : "",
flags & LCK_CONVERT ? "CONVERT|" : "");
flags & LCK_CONVERT ? "CONVERT|" : "",
flags & LCK_DMEVENTD_MONITOR_IGNORE ? "DMEVENTD_MONITOR_IGNORE|" : "");
if (len > 1)
buf[len - 2] = ' ';
@ -512,10 +513,14 @@ int do_lock_lv(unsigned char command, unsigned char lock_flags, char *resource)
if (lock_flags & LCK_MIRROR_NOSYNC_MODE)
init_mirror_in_sync(1);
if (lock_flags & LCK_DMEVENTD_MONITOR_MODE)
init_dmeventd_monitor(1);
else
init_dmeventd_monitor(0);
if (lock_flags & LCK_DMEVENTD_MONITOR_IGNORE)
init_dmeventd_monitor(DMEVENTD_MONITOR_IGNORE);
else {
if (lock_flags & LCK_DMEVENTD_MONITOR_MODE)
init_dmeventd_monitor(1);
else
init_dmeventd_monitor(0);
}
cmd->partial_activation = (lock_flags & LCK_PARTIAL_MODE) ? 1 : 0;

View File

@ -341,7 +341,10 @@ static int _lock_for_cluster(struct cmd_context *cmd, unsigned char clvmd_cmd,
* But DMEVENTD_MONITOR_IGNORE is not propagated across the cluster.
*/
dmeventd_mode = dmeventd_monitor_mode();
if (dmeventd_mode != DMEVENTD_MONITOR_IGNORE && dmeventd_mode)
if (dmeventd_mode == DMEVENTD_MONITOR_IGNORE)
args[1] |= LCK_DMEVENTD_MONITOR_IGNORE;
if (dmeventd_mode)
args[1] |= LCK_DMEVENTD_MONITOR_MODE;
if (cmd->partial_activation)

View File

@ -109,6 +109,7 @@ int check_lvm1_vg_inactive(struct cmd_context *cmd, const char *vgname);
#define LCK_ORIGIN_ONLY_MODE 0x20 /* Same as above */
#define LCK_TEST_MODE 0x10 /* Test mode: No activation */
#define LCK_REVERT_MODE 0x40 /* Remove inactive tables */
#define LCK_DMEVENTD_MONITOR_IGNORE 0x80 /* Whether to ignore dmeventd */
/*
* Special cases of VG locks.