summaryrefslogtreecommitdiffstats
path: root/daemons/clvmd/lvm-functions.c
diff options
context:
space:
mode:
authorChristine Caulfield <ccaulfie@redhat.com>2009-08-05 14:18:35 +0000
committerChristine Caulfield <ccaulfie@redhat.com>2009-08-05 14:18:35 +0000
commitee1e49ec53c882916bfcff7c6b93abc0f3d0a799 (patch)
tree704c489ebf03b5c7526034f612f13cb46003030f /daemons/clvmd/lvm-functions.c
parent56aba8dc9d943ad6e5f45bac9a8b5d4c42643443 (diff)
downloadlvm2-ee1e49ec53c882916bfcff7c6b93abc0f3d0a799.tar.gz
lvm2-ee1e49ec53c882916bfcff7c6b93abc0f3d0a799.tar.xz
lvm2-ee1e49ec53c882916bfcff7c6b93abc0f3d0a799.zip
Fix locking in clvmd
The changes to remove LCK_NONBLOCK from the LVM locks broke clvmd because the code was clearly wrong but working anyway! The constant was being masked rather than the variable that was supposed to match against it.
Diffstat (limited to 'daemons/clvmd/lvm-functions.c')
-rw-r--r--daemons/clvmd/lvm-functions.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/daemons/clvmd/lvm-functions.c b/daemons/clvmd/lvm-functions.c
index eb9ad6fb..23d740c9 100644
--- a/daemons/clvmd/lvm-functions.c
+++ b/daemons/clvmd/lvm-functions.c
@@ -479,29 +479,29 @@ int do_lock_lv(unsigned char command, unsigned char lock_flags, char *resource)
cmd->partial_activation = (lock_flags & LCK_PARTIAL_MODE) ? 1 : 0;
- switch (command) {
- case LCK_LV_EXCLUSIVE & LCK_MASK:
+ switch (command & LCK_MASK) {
+ case LCK_LV_EXCLUSIVE:
status = do_activate_lv(resource, lock_flags, LKM_EXMODE);
break;
- case LCK_LV_SUSPEND & LCK_MASK:
+ case LCK_LV_SUSPEND:
status = do_suspend_lv(resource);
if (!status)
suspended++;
break;
case LCK_UNLOCK:
- case LCK_LV_RESUME & LCK_MASK: /* if active */
+ case LCK_LV_RESUME: /* if active */
status = do_resume_lv(resource);
if (!status)
suspended--;
break;
- case LCK_LV_ACTIVATE & LCK_MASK:
+ case LCK_LV_ACTIVATE:
status = do_activate_lv(resource, lock_flags, LKM_CRMODE);
break;
- case LCK_LV_DEACTIVATE & LCK_MASK:
+ case LCK_LV_DEACTIVATE:
status = do_deactivate_lv(resource, lock_flags);
break;