1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-02-03 17:47:44 +03:00

Re-instate partial activation support in clustered mode. (mornfall)

This commit is contained in:
Milan Broz 2009-06-12 08:30:19 +00:00
parent 630dbab749
commit 89576aa2c1
4 changed files with 16 additions and 4 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.48 -
===============================
Re-instate partial activation support in clustered mode. (2.02.40)
Use 'lvm lvresize' instead of 'lvresize' in fsadm.
Do not use '-n' realine option in fsadm for busybox compatiblity.
Update vgrename, vgsplit, and vgcreate to use vg_lock_newname.

View File

@ -145,7 +145,8 @@ static const char *decode_flags(unsigned char flags)
{
static char buf[128];
sprintf(buf, "0x%x (%s%s)", flags,
sprintf(buf, "0x%x (%s%s%s)", flags,
flags & LCK_PARTIAL_MODE ? "PARTIAL_MODE " : "",
flags & LCK_MIRROR_NOSYNC_MODE ? "MIRROR_NOSYNC " : "",
flags & LCK_DMEVENTD_MONITOR_MODE ? "DMEVENTD_MONITOR " : "");
@ -478,6 +479,8 @@ int do_lock_lv(unsigned char command, unsigned char lock_flags, char *resource)
if (!(lock_flags & LCK_DMEVENTD_MONITOR_MODE))
init_dmeventd_monitor(0);
cmd->partial_activation = (lock_flags & LCK_PARTIAL_MODE) ? 1 : 0;
switch (command) {
case LCK_LV_EXCLUSIVE:
status = do_activate_lv(resource, lock_flags, LKM_EXMODE);
@ -516,6 +519,8 @@ int do_lock_lv(unsigned char command, unsigned char lock_flags, char *resource)
if (!(lock_flags & LCK_DMEVENTD_MONITOR_MODE))
init_dmeventd_monitor(DEFAULT_DMEVENTD_MONITOR);
cmd->partial_activation = 0;
/* clean the pool for another command */
dm_pool_empty(cmd->mem);
pthread_mutex_unlock(&lvm_lock);

View File

@ -24,6 +24,7 @@
#include "lvm-string.h"
#include "locking.h"
#include "locking_types.h"
#include "toolcontext.h"
#include <assert.h>
#include <stddef.h>
@ -298,7 +299,8 @@ static int _cluster_free_request(lvm_response_t * response, int num)
return 1;
}
static int _lock_for_cluster(unsigned char clvmd_cmd, uint32_t flags, const char *name)
static int _lock_for_cluster(struct cmd_context *cmd, unsigned char clvmd_cmd,
uint32_t flags, const char *name)
{
int status;
int i;
@ -324,6 +326,9 @@ static int _lock_for_cluster(unsigned char clvmd_cmd, uint32_t flags, const char
if (dmeventd_monitor_mode())
args[1] |= LCK_DMEVENTD_MONITOR_MODE;
if (cmd->partial_activation)
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
@ -389,7 +394,7 @@ int lock_resource(struct cmd_context *cmd, const char *resource, uint32_t flags)
if (flags == LCK_VG_BACKUP) {
log_very_verbose("Requesting backup of VG metadata for %s",
resource);
return _lock_for_cluster(CLVMD_CMD_VG_BACKUP,
return _lock_for_cluster(cmd, CLVMD_CMD_VG_BACKUP,
LCK_CLUSTER_VG, resource);
}
@ -453,7 +458,7 @@ int lock_resource(struct cmd_context *cmd, const char *resource, uint32_t flags)
flags);
/* Send a message to the cluster manager */
return _lock_for_cluster(clvmd_cmd, flags, lockname);
return _lock_for_cluster(cmd, clvmd_cmd, flags, lockname);
}
static int decode_lock_type(const char *response)

View File

@ -85,6 +85,7 @@ int check_lvm1_vg_inactive(struct cmd_context *cmd, const char *vgname);
/*
* Additional lock bits for cluster communication
*/
#define LCK_PARTIAL_MODE 0x00000001U /* Partial activation? */
#define LCK_MIRROR_NOSYNC_MODE 0x00000002U /* Mirrors don't require sync */
#define LCK_DMEVENTD_MONITOR_MODE 0x00000004U /* Register with dmeventd */