diff options
Diffstat (limited to 'daemons/clvmd')
-rw-r--r-- | daemons/clvmd/clvmd-command.c | 12 | ||||
-rw-r--r-- | daemons/clvmd/lvm-functions.c | 3 |
2 files changed, 8 insertions, 7 deletions
diff --git a/daemons/clvmd/clvmd-command.c b/daemons/clvmd/clvmd-command.c index 8e544e90..3b1379fe 100644 --- a/daemons/clvmd/clvmd-command.c +++ b/daemons/clvmd/clvmd-command.c @@ -118,10 +118,10 @@ int do_command(struct local_client *client, struct clvm_header *msg, int msglen, lockname = &args[2]; /* Check to see if the VG is in use by LVM1 */ status = do_check_lvm1(lockname); - /* P_#global causes a cache refresh */ - if (strcmp(lockname, "P_#global") == 0) - do_refresh_cache(); - else if (strncmp(lockname, "P_", 2) == 0) + /* P_#global causes a full cache refresh */ + if (!strcmp(lockname, "P_#global")) + do_refresh_cache(); + else drop_metadata(lockname + 2); break; @@ -254,9 +254,9 @@ int do_pre_command(struct local_client *client) case CLVMD_CMD_LOCK_VG: lockname = &args[2]; - /* Do not use lock for cache related commands */ + /* We take out a real lock unless LCK_CACHE was set */ if (!strncmp(lockname, "V_", 2) || - !strcmp(lockname, "P_#global")) + !strncmp(lockname, "P_#", 3)) status = lock_vg(client); break; diff --git a/daemons/clvmd/lvm-functions.c b/daemons/clvmd/lvm-functions.c index 08c370be..84e0aa5d 100644 --- a/daemons/clvmd/lvm-functions.c +++ b/daemons/clvmd/lvm-functions.c @@ -472,7 +472,8 @@ static void drop_vg_locks() popen ("lvm pvs --config 'log{command_names=0 prefix=\"\"}' --nolocking --noheadings -o vg_name", "r"); - sync_unlock("P_orphans", LCK_EXCL); + sync_unlock("P_#orphans", LCK_EXCL); + sync_unlock("P_#global", LCK_EXCL); if (!vgs) return; |