mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
Get rid of magic masks in cluster locking code - clvmd part.
- do_command and lock_vg expect flags (no change here) Bug fixes: - lock_vg should check for NONBLOCK on lock_cmd, flags have this bit masked-out - do_pre/post_command expect do not mask flag at all, this causes that the code inside is never run! (see following patches, these functions expect plain command without flags)
This commit is contained in:
parent
7251c8f3a5
commit
cc31b2bd3f
@ -1,5 +1,6 @@
|
||||
Version 2.02.57 -
|
||||
====================================
|
||||
Replace magic masks in cluster locking code by defined masks.
|
||||
Remove log volume from metadata if initial deactivation fails.
|
||||
Give better error message for pvmove when all data is skipped.
|
||||
Fix memory lock imbalance in lv_suspend if already suspended.
|
||||
|
@ -132,7 +132,7 @@ int do_command(struct local_client *client, struct clvm_header *msg, int msglen,
|
||||
|
||||
case CLVMD_CMD_LOCK_LV:
|
||||
/* This is the biggie */
|
||||
lock_cmd = args[0] & 0x3F;
|
||||
lock_cmd = args[0] & (LCK_NONBLOCK | LCK_HOLD | LCK_SCOPE_MASK | LCK_TYPE_MASK);
|
||||
lock_flags = args[1];
|
||||
lockname = &args[2];
|
||||
status = do_lock_lv(lock_cmd, lock_flags, lockname);
|
||||
@ -214,7 +214,7 @@ static int lock_vg(struct local_client *client)
|
||||
client->bits.localsock.private = (void *)lock_hash;
|
||||
}
|
||||
|
||||
lock_cmd = args[0] & 0x3F;
|
||||
lock_cmd = args[0] & (LCK_NONBLOCK | LCK_HOLD | LCK_SCOPE_MASK | LCK_TYPE_MASK);
|
||||
lock_flags = args[1];
|
||||
lockname = &args[2];
|
||||
DEBUGLOG("doing PRE command LOCK_VG '%s' at %x (client=%p)\n", lockname, lock_cmd, client);
|
||||
@ -237,7 +237,7 @@ static int lock_vg(struct local_client *client)
|
||||
lock_cmd &= ~LCK_TYPE_MASK;
|
||||
lock_cmd |= LCK_PREAD;
|
||||
}
|
||||
status = sync_lock(lockname, (int)lock_cmd, (lock_flags & LCK_NONBLOCK) ? LKF_NOQUEUE : 0, &lkid);
|
||||
status = sync_lock(lockname, (int)lock_cmd, (lock_cmd & LCK_NONBLOCK) ? LKF_NOQUEUE : 0, &lkid);
|
||||
if (status)
|
||||
status = errno;
|
||||
else
|
||||
|
@ -542,7 +542,7 @@ int pre_lock_lv(unsigned char command, unsigned char lock_flags, char *resource)
|
||||
lock out on this node (because we are the node modifying the metadata)
|
||||
before suspending cluster-wide.
|
||||
*/
|
||||
if (command == LCK_LV_SUSPEND) {
|
||||
if ((command & (LCK_SCOPE_MASK | LCK_TYPE_MASK)) == LCK_LV_SUSPEND) {
|
||||
DEBUGLOG("pre_lock_lv: resource '%s', cmd = %s, flags = %s\n",
|
||||
resource, decode_locking_cmd(command), decode_flags(lock_flags));
|
||||
|
||||
@ -559,7 +559,7 @@ int post_lock_lv(unsigned char command, unsigned char lock_flags,
|
||||
int status;
|
||||
|
||||
/* Opposite of above, done on resume after a metadata update */
|
||||
if (command == LCK_LV_RESUME) {
|
||||
if ((command & (LCK_SCOPE_MASK | LCK_TYPE_MASK)) == LCK_LV_RESUME) {
|
||||
int oldmode;
|
||||
|
||||
DEBUGLOG
|
||||
|
Loading…
Reference in New Issue
Block a user