]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
GlusterFS: Synchronize additional operations
authorEric Harney <eharney@redhat.com>
Fri, 10 Jan 2014 19:20:41 +0000 (14:20 -0500)
committerEric Harney <eharney@redhat.com>
Wed, 15 Jan 2014 15:52:02 +0000 (10:52 -0500)
create_cloned_volume() and copy_volume_to_image() should also be
locked against other driver operations to prevent collisions
from concurrent updates of snapshot metadata or volume file data.

Closes-Bug: #1267983

Change-Id: Idd6158bfbe4dc049c33fa58b40d3d570fc244d01

cinder/volume/drivers/glusterfs.py

index a7d27621197431f30d6d5d93c46b3920fb042d38..71ac852a04700b5b36e230b0276323c610d9f50d 100644 (file)
@@ -154,6 +154,7 @@ class GlusterfsDriver(nfs.RemoteFsDriver):
 
         return snap_info['active']
 
+    @utils.synchronized('glusterfs', external=False)
     def create_cloned_volume(self, volume, src_vref):
         """Creates a clone of the specified volume."""
 
@@ -902,6 +903,7 @@ class GlusterfsDriver(nfs.RemoteFsDriver):
         """Disallow connection from connector."""
         pass
 
+    @utils.synchronized('glusterfs', external=False)
     def copy_volume_to_image(self, context, volume, image_service, image_meta):
         """Copy the volume to the specified image."""