From 9f5d8283a9a6c2a10b64946c6cd2b99298db5456 Mon Sep 17 00:00:00 2001 From: Alasdair Kergon Date: Thu, 9 Mar 2006 22:34:13 +0000 Subject: [PATCH] Propagate partial mode around cluster. --- WHATS_NEW | 1 + daemons/clvmd/lvm-functions.c | 6 ++++++ lib/locking/cluster_locking.c | 3 +++ lib/locking/locking.h | 5 +++++ 4 files changed, 15 insertions(+) diff --git a/WHATS_NEW b/WHATS_NEW index 7afe5d61e..4859e3cdd 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.03 - =================================== + Propagate partial mode around cluster. Fix archive file expiration. Fix dmeventd build. diff --git a/daemons/clvmd/lvm-functions.c b/daemons/clvmd/lvm-functions.c index f3ef305db..c8207a489 100644 --- a/daemons/clvmd/lvm-functions.c +++ b/daemons/clvmd/lvm-functions.c @@ -303,6 +303,9 @@ int do_lock_lv(unsigned char command, unsigned char lock_flags, char *resource) } } + if (lock_flags & LCK_PARTIAL_MODE) + init_partial(1); + switch (command) { case LCK_LV_EXCLUSIVE: status = do_activate_lv(resource, lock_flags, LKM_EXMODE); @@ -331,6 +334,9 @@ int do_lock_lv(unsigned char command, unsigned char lock_flags, char *resource) break; } + if (lock_flags & LCK_PARTIAL_MODE) + init_partial(0); + /* clean the pool for another command */ dm_pool_empty(cmd->mem); diff --git a/lib/locking/cluster_locking.c b/lib/locking/cluster_locking.c index 43062527c..15271b937 100644 --- a/lib/locking/cluster_locking.c +++ b/lib/locking/cluster_locking.c @@ -330,6 +330,9 @@ static int _lock_for_cluster(unsigned char cmd, unsigned int flags, char *name) args[0] = flags & 0x7F; /* Maskoff lock flags */ args[1] = flags & 0xC0; /* Bitmap flags */ + if (partial_mode()) + args[1] |= LCK_PARTIAL_MODE; + /* * VG locks are just that: locks, and have no side effects * so we only need to do them on the local node because all diff --git a/lib/locking/locking.h b/lib/locking/locking.h index dae1549f2..c01984f40 100644 --- a/lib/locking/locking.h +++ b/lib/locking/locking.h @@ -67,6 +67,11 @@ int check_lvm1_vg_inactive(struct cmd_context *cmd, const char *vgname); #define LCK_LOCAL 0x00000040 /* Don't propagate to other nodes */ #define LCK_CLUSTER_VG 0x00000080 /* VG is clustered */ +/* + * Additional lock bits for cluster communication + */ +#define LCK_PARTIAL_MODE 0x00000001 /* Running in partial mode */ + /* * Common combinations */