Commit d6e1e696 authored by Hrvoje Ribicic's avatar Hrvoje Ribicic
Browse files

Lock node if zeroing is used in LUBackupExport



This patch adds a node lock if zeroing is used, preventing any
operations that might interfere with the amount of available space.
Signed-off-by: default avatarHrvoje Ribicic <riba@google.com>
Reviewed-by: default avatarJose A. Lopes <jabolopes@google.com>
parent cfa8cbe5
......@@ -123,6 +123,13 @@ class LUBackupExport(LogicalUnit):
def ExpandNames(self):
self._ExpandAndLockInstance()
# In case we are zeroing, a node lock is required as we will be creating and
# destroying a disk - allocations should be stopped, but not on the entire
# cluster
if self.op.zero_free_space:
self.recalculate_locks = {locking.LEVEL_NODE: constants.LOCKS_REPLACE}
self._LockInstancesNodes(primary_only=True)
# Lock all nodes for local exports
if self.op.mode == constants.EXPORT_MODE_LOCAL:
(self.op.target_node_uuid, self.op.target_node) = \
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment