[openstack-cinder] Fix GlusterFS volume driver clone operations

Eric Harney eharney at fedoraproject.org
Mon Oct 28 19:18:54 UTC 2013


commit 77c41d3de3f7ff0b9b31571a7bd34c45fcf486a4
Author: Eric Harney <eharney at redhat.com>
Date:   Mon Oct 28 12:07:14 2013 -0400

    Fix GlusterFS volume driver clone operations
    
    Updated patches from master-patches

 ...-set-correct-filename-when-cloning-volume.patch |   64 ++++++++++++++++++++
 openstack-cinder.spec                              |    7 ++-
 2 files changed, 70 insertions(+), 1 deletions(-)
---
diff --git a/0004-GlusterFS-set-correct-filename-when-cloning-volume.patch b/0004-GlusterFS-set-correct-filename-when-cloning-volume.patch
new file mode 100644
index 0000000..b1b284a
--- /dev/null
+++ b/0004-GlusterFS-set-correct-filename-when-cloning-volume.patch
@@ -0,0 +1,64 @@
+From 824c6cd3964b4d42118324f6770891fe19a2fea7 Mon Sep 17 00:00:00 2001
+From: Eric Harney <eharney at redhat.com>
+Date: Thu, 24 Oct 2013 16:18:54 -0400
+Subject: [PATCH] GlusterFS: set correct filename when cloning volume
+
+When cloning a volume, the volume[name] field was populated
+with incorrect data, resulting in an unexpected filename containing
+the volume data.  This results in failures of later operations on
+that cloned volume.
+
+(cherry picked from commit bfb66019edd197141ea1462ba78dd27a2ed0e40d)
+
+Resolves: rhbz #1023065
+
+Upstream-Havana: https://review.openstack.org/#/c/53897/
+Upstream-Icehouse: https://review.openstack.org/#/c/53735/
+Launchpad Bug: #1244238
+Change-Id: I067ed44cebdc8e91e9ded326953fd0c99d003f05
+---
+ cinder/tests/test_glusterfs.py     | 4 ++--
+ cinder/volume/drivers/glusterfs.py | 4 ++--
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/cinder/tests/test_glusterfs.py b/cinder/tests/test_glusterfs.py
+index ef34fd4..44c78c9 100644
+--- a/cinder/tests/test_glusterfs.py
++++ b/cinder/tests/test_glusterfs.py
+@@ -600,7 +600,7 @@ class GlusterFsDriverTestCase(test.TestCase):
+                                     volume_file)
+         src_info_path = '%s.info' % volume_path
+         volume_ref = {'id': volume['id'],
+-                      'name': volume['name'] + '-clone',
++                      'name': volume['name'],
+                       'status': volume['status'],
+                       'provider_location': volume['provider_location'],
+                       'size': volume['size']}
+@@ -1508,7 +1508,7 @@ class GlusterFsDriverTestCase(test.TestCase):
+                       'size': volume['size'],
+                       'status': volume['status'],
+                       'provider_location': volume['provider_location'],
+-                      'name': 'volume-' + volume['id'] + '-clone'}
++                      'name': 'volume-' + volume['id']}
+ 
+         drv.create_snapshot(snap_ref)
+         drv._copy_volume_from_snapshot(snap_ref,
+diff --git a/cinder/volume/drivers/glusterfs.py b/cinder/volume/drivers/glusterfs.py
+index bd4293f..0987be0 100644
+--- a/cinder/volume/drivers/glusterfs.py
++++ b/cinder/volume/drivers/glusterfs.py
+@@ -162,12 +162,12 @@ class GlusterfsDriver(nfs.RemoteFsDriver):
+             msg = _("Volume status must be 'available'.")
+             raise exception.InvalidVolume(msg)
+ 
+-        volume_name = CONF.volume_name_template % src_vref['id']
++        volume_name = CONF.volume_name_template % volume['id']
+ 
+         volume_info = {'provider_location': src_vref['provider_location'],
+                        'size': src_vref['size'],
+                        'id': volume['id'],
+-                       'name': '%s-clone' % volume_name,
++                       'name': volume_name,
+                        'status': src_vref['status']}
+         temp_snapshot = {'volume_name': volume_name,
+                          'size': src_vref['size'],
diff --git a/openstack-cinder.spec b/openstack-cinder.spec
index c6839a9..a8f230d 100644
--- a/openstack-cinder.spec
+++ b/openstack-cinder.spec
@@ -2,7 +2,7 @@
 
 Name:             openstack-cinder
 Version:          2013.2
-Release:          1%{?dist}
+Release:          2%{?dist}
 Summary:          OpenStack Volume service
 
 Group:            Applications/System
@@ -26,6 +26,7 @@ Source20:         cinder-sudoers
 Patch0001: 0001-Ensure-we-don-t-access-the-net-when-building-docs.patch
 Patch0002: 0002-Remove-runtime-dep-on-python-pbr-python-d2to1.patch
 Patch0003: 0003-Revert-Use-oslo.sphinx-and-remove-local-copy-of-doc-.patch
+Patch0004: 0004-GlusterFS-set-correct-filename-when-cloning-volume.patch
 
 BuildArch:        noarch
 BuildRequires:    intltool
@@ -137,6 +138,7 @@ This package contains documentation files for cinder.
 %patch0001 -p1
 %patch0002 -p1
 %patch0003 -p1
+%patch0004 -p1
 
 find . \( -name .gitignore -o -name .placeholder \) -delete
 
@@ -295,6 +297,9 @@ fi
 %endif
 
 %changelog
+* Mon Oct 28 2013 Eric Harney <eharney at redhat.com> - 2013.2-2
+- Fix GlusterFS volume driver clone operations
+
 * Thu Oct 17 2013 Eric Harney <eharney at redhat.com> - 2013.2-1
 - Update to 2013.2 (Havana)
 - Restart/remove cinder-backup service during upgrade/uninstallation


More information about the scm-commits mailing list