summaryrefslogtreecommitdiffstats
path: root/tools/vgscan.c
diff options
context:
space:
mode:
authorAlasdair Kergon <agk@redhat.com>2007-08-23 15:02:26 +0000
committerAlasdair Kergon <agk@redhat.com>2007-08-23 15:02:26 +0000
commite935d217520c85eae165cbff0e31065f97a98160 (patch)
tree11a1bee289e7661c9d95f27e9039a59cea5abb4a /tools/vgscan.c
parentf608f304071449c72b147e1dfe29a907ff40bfa8 (diff)
downloadlvm2-e935d217520c85eae165cbff0e31065f97a98160.tar.gz
lvm2-e935d217520c85eae165cbff0e31065f97a98160.tar.xz
lvm2-e935d217520c85eae165cbff0e31065f97a98160.zip
Introduce VG_GLOBAL lock type for vgscan/pvscan to trigger clvmd -R.
Diffstat (limited to 'tools/vgscan.c')
-rw-r--r--tools/vgscan.c6
1 files changed, 6 insertions, 0 deletions
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;
}