From e935d217520c85eae165cbff0e31065f97a98160 Mon Sep 17 00:00:00 2001 From: Alasdair Kergon Date: Thu, 23 Aug 2007 15:02:26 +0000 Subject: Introduce VG_GLOBAL lock type for vgscan/pvscan to trigger clvmd -R. --- tools/vgscan.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tools/vgscan.c') diff --git a/tools/vgscan.c b/tools/vgscan.c index 15b33a3b..65e678f9 100644 --- a/tools/vgscan.c +++ b/tools/vgscan.c @@ -51,6 +51,11 @@ int vgscan(struct cmd_context *cmd, int argc, char **argv) return EINVALID_CMD_LINE; } + if (!lock_vol(cmd, VG_GLOBAL, LCK_VG_WRITE)) { + log_error("Unable to obtain global lock."); + return ECMD_FAILED; + } + persistent_filter_wipe(cmd->filter); lvmcache_destroy(); @@ -65,5 +70,6 @@ int vgscan(struct cmd_context *cmd, int argc, char **argv) maxret = ret; } + unlock_vg(cmd, VG_GLOBAL); return maxret; } -- cgit