Peter Rajnoha 785220
diff --git a/WHATS_NEW b/WHATS_NEW
Peter Rajnoha 785220
index c0ae3df..5887ec7 100644
Peter Rajnoha 785220
--- a/WHATS_NEW
Peter Rajnoha 785220
+++ b/WHATS_NEW
Peter Rajnoha 785220
@@ -1,3 +1,7 @@
Peter Rajnoha 785220
+Version 2.02.99 - 
Peter Rajnoha 785220
+===================================
Peter Rajnoha 785220
+  Hardcode use_lvmetad=0 if cluster locking used and issue a warning msg.
Peter Rajnoha 785220
+
Peter Rajnoha 785220
 Version 2.02.98 - 15th October 2012
Peter Rajnoha 785220
 ===================================
Peter Rajnoha 785220
   Switch from DEBUG() to DEBUGLOG() in lvmetad as -DDEBUG is already used.
Peter Rajnoha 785220
diff --git a/lib/commands/toolcontext.c b/lib/commands/toolcontext.c
Peter Rajnoha 785220
index d7f8ece..eb1a90b 100644
Peter Rajnoha 785220
--- a/lib/commands/toolcontext.c
Peter Rajnoha 785220
+++ b/lib/commands/toolcontext.c
Peter Rajnoha 785220
@@ -413,7 +413,15 @@ static int _process_config(struct cmd_context *cmd)
Peter Rajnoha 785220
 	lvmetad_set_socket(lvmetad_socket);
Peter Rajnoha 785220
 	cn = find_config_tree_node(cmd, "devices/global_filter");
Peter Rajnoha 785220
 	lvmetad_set_token(cn ? cn->v : NULL);
Peter Rajnoha 785220
-	lvmetad_set_active(find_config_tree_int(cmd, "global/use_lvmetad", 1));
Peter Rajnoha 785220
+
Peter Rajnoha 785220
+	if (find_config_tree_int(cmd, "global/locking_type", 1) == 3 &&
Peter Rajnoha 785220
+	    find_config_tree_int(cmd, "global/use_lvmetad", 1)) {
Peter Rajnoha 785220
+		log_warn("WARNING: configuration setting use_lvmetad overriden to 0 due to locking_type 3. "
Peter Rajnoha 785220
+			 "Clustered environment not supported by lvmetad yet.");
Peter Rajnoha 785220
+		lvmetad_set_active(0);
Peter Rajnoha 785220
+	} else
Peter Rajnoha 785220
+		lvmetad_set_active(find_config_tree_int(cmd, "global/use_lvmetad", 1));
Peter Rajnoha 785220
+
Peter Rajnoha 785220
 	lvmetad_init(cmd);
Peter Rajnoha 785220
 
Peter Rajnoha 785220
 	return 1;
Peter Rajnoha 785220
diff --git a/test/shell/lvmetad-no-cluster.sh b/test/shell/lvmetad-no-cluster.sh
Peter Rajnoha 785220
new file mode 100644
Peter Rajnoha 785220
index 0000000..db68e77
Peter Rajnoha 785220
--- /dev/null
Peter Rajnoha 785220
+++ b/test/shell/lvmetad-no-cluster.sh
Peter Rajnoha 785220
@@ -0,0 +1,19 @@
Peter Rajnoha 785220
+#!/bin/sh
Peter Rajnoha 785220
+# Copyright (C) 2012 Red Hat, Inc. All rights reserved.
Peter Rajnoha 785220
+#
Peter Rajnoha 785220
+# This copyrighted material is made available to anyone wishing to use,
Peter Rajnoha 785220
+# modify, copy, or redistribute it subject to the terms and conditions
Peter Rajnoha 785220
+# of the GNU General Public License v.2.
Peter Rajnoha 785220
+#
Peter Rajnoha 785220
+# You should have received a copy of the GNU General Public License
Peter Rajnoha 785220
+# along with this program; if not, write to the Free Software Foundation,
Peter Rajnoha 785220
+# Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
Peter Rajnoha 785220
+
Peter Rajnoha 785220
+. lib/test
Peter Rajnoha 785220
+
Peter Rajnoha 785220
+test -e LOCAL_CLVMD || skip
Peter Rajnoha 785220
+aux prepare_vg 2
Peter Rajnoha 785220
+aux prepare_lvmetad
Peter Rajnoha 785220
+vgs -vv 2> errs
Peter Rajnoha 785220
+cat errs
Peter Rajnoha 785220
+grep 'use_lvmetad' errs