diff --git a/lib/cmdlib.py b/lib/cmdlib.py
index 056f21eff7e6d64bb44fac8ff6569ad0be83a629..cfb708b608a8214ac426530b0f243e0c4dfb8924 100644
--- a/lib/cmdlib.py
+++ b/lib/cmdlib.py
@@ -5227,6 +5227,7 @@ class _NodeQuery(_QueryBase):
     if self.do_locking:
       # If any non-static field is requested we need to lock the nodes
       lu.needed_locks[locking.LEVEL_NODE] = self.wanted
+      lu.needed_locks[locking.LEVEL_NODE_ALLOC] = locking.ALL_SET
 
   def DeclareLocks(self, lu, level):
     pass