From 51305499667e75ec2e5dbc564b111c2d0117bcb0 Mon Sep 17 00:00:00 2001
From: Michael Hanselmann <hansmi@google.com>
Date: Fri, 23 Nov 2012 04:39:46 +0100
Subject: [PATCH] LUGroupVerifyDisks: Use node allocation lock

See comment in code.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
---
 lib/cmdlib.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lib/cmdlib.py b/lib/cmdlib.py
index 92b881df7..a795c4f75 100644
--- a/lib/cmdlib.py
+++ b/lib/cmdlib.py
@@ -3685,6 +3685,12 @@ class LUGroupVerifyDisks(NoHooksLU):
       locking.LEVEL_INSTANCE: [],
       locking.LEVEL_NODEGROUP: [],
       locking.LEVEL_NODE: [],
+
+      # This opcode is acquires all node locks in a group. LUClusterVerifyDisks
+      # starts one instance of this opcode for every group, which means all
+      # nodes will be locked for a short amount of time, so it's better to
+      # acquire the node allocation lock as well.
+      locking.LEVEL_NODE_ALLOC: locking.ALL_SET,
       }
 
   def DeclareLocks(self, level):
-- 
GitLab