summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--daemons/clvmd/clvmd-command.c1
-rw-r--r--lib/locking/file_locking.c1
-rw-r--r--lib/locking/locking.c4
3 files changed, 2 insertions, 4 deletions
diff --git a/daemons/clvmd/clvmd-command.c b/daemons/clvmd/clvmd-command.c
index 6d0dee4a..38727021 100644
--- a/daemons/clvmd/clvmd-command.c
+++ b/daemons/clvmd/clvmd-command.c
@@ -217,6 +217,7 @@ static int lock_vg(struct local_client *client)
if (lkid == 0)
return EINVAL;
+ lvm_do_fs_unlock(); /* Wait for devices */
status = sync_unlock(lockname, lkid);
if (status)
status = errno;
diff --git a/lib/locking/file_locking.c b/lib/locking/file_locking.c
index 68b0420b..0c8bbed4 100644
--- a/lib/locking/file_locking.c
+++ b/lib/locking/file_locking.c
@@ -215,6 +215,7 @@ static int _lock_file(const char *file, uint32_t flags)
state = 'W';
break;
case LCK_UNLOCK:
+ fs_unlock(); /* Wait until devices are available */
return _release_lock(file, 1);
default:
log_error("Unrecognised lock type: %d", flags & LCK_TYPE_MASK);
diff --git a/lib/locking/locking.c b/lib/locking/locking.c
index c9236104..645f25d5 100644
--- a/lib/locking/locking.c
+++ b/lib/locking/locking.c
@@ -442,10 +442,6 @@ int lock_vol(struct cmd_context *cmd, const char *vol, uint32_t flags)
/* If LVM1 driver knows about the VG, it can't be accessed. */
if (!check_lvm1_vg_inactive(cmd, vol))
return_0;
-
- /* Before unlocking VG wait until devices are available. */
- if ((flags & LCK_TYPE_MASK) == LCK_UNLOCK)
- sync_local_dev_names(cmd);
break;
case LCK_LV:
/* All LV locks are non-blocking. */