From d4fd789d789bef38eae7bf7bd144755471ac7a60 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Wed, 2 Feb 2011 20:04:39 +0000 Subject: [PATCH] Better fix for no-locking udev sync and clvmd This is better way how to fix clustered synchronization with udev. As the code for message passing needs fixed - put currently fs_unlock() after every active/deactive command in clvmd to ensure nodes are properly created in time. --- daemons/clvmd/lvm-functions.c | 3 +++ lib/locking/no_locking.c | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/daemons/clvmd/lvm-functions.c b/daemons/clvmd/lvm-functions.c index f06657d9e..7d0e44447 100644 --- a/daemons/clvmd/lvm-functions.c +++ b/daemons/clvmd/lvm-functions.c @@ -507,6 +507,7 @@ int do_lock_lv(unsigned char command, unsigned char lock_flags, char *resource) switch (command & LCK_MASK) { case LCK_LV_EXCLUSIVE: status = do_activate_lv(resource, lock_flags, LCK_EXCL); + fs_unlock(); break; case LCK_LV_SUSPEND: @@ -520,10 +521,12 @@ int do_lock_lv(unsigned char command, unsigned char lock_flags, char *resource) case LCK_LV_ACTIVATE: status = do_activate_lv(resource, lock_flags, LCK_READ); + fs_unlock(); break; case LCK_LV_DEACTIVATE: status = do_deactivate_lv(resource, lock_flags); + fs_unlock(); break; default: diff --git a/lib/locking/no_locking.c b/lib/locking/no_locking.c index 3ad0d38b2..87c1e0ff6 100644 --- a/lib/locking/no_locking.c +++ b/lib/locking/no_locking.c @@ -38,7 +38,9 @@ static int _no_lock_resource(struct cmd_context *cmd, const char *resource, { switch (flags & LCK_SCOPE_MASK) { case LCK_VG: - if (!strcmp(resource, VG_SYNC_NAMES)) + if (!strcmp(resource, VG_SYNC_NAMES) || + (((flags & LCK_TYPE_MASK) == LCK_UNLOCK) && + is_real_vg(resource))) fs_unlock(); break; case LCK_LV: