diff --git a/daemons/clvmd/clvmd-command.c b/daemons/clvmd/clvmd-command.c index 6d0dee4ad..387270213 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 68b0420b8..0c8bbed4f 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 c92361044..645f25d57 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. */