]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
SMBFS: Fix missing volume provider location
authorLucian Petrut <lpetrut@cloudbasesolutions.com>
Fri, 27 Mar 2015 11:42:22 +0000 (13:42 +0200)
committerLucian Petrut <lpetrut@cloudbasesolutions.com>
Fri, 27 Mar 2015 11:42:22 +0000 (13:42 +0200)
In case of cloning volumes or creating volumes from snapshots, the
volume provider location is not set, making the volumes unusable.

This also leads to disk image leaks, because the delete volume
operation will pass without deleting the disk image if the provider
location is not present.

The SMB driver wraps base RemoteFS methods in order to set locks.
The issue is that it does not return the wrapped method return
value, which signals volume updates, in this case the provider
location.

Change-Id: Id7435676052885d301a48fa5ac224071e18ecf5b
Closes-Bug: #1437271

cinder/volume/drivers/smbfs.py

index 3c94d9c1cf5ff42ab7d28aa4ee71d347f62bdec8..eb4a54dd9617b509552ac73b6d1a6dccfaba080c 100644 (file)
@@ -479,7 +479,7 @@ class SmbfsDriver(remotefs_drv.RemoteFSSnapDriver):
 
     @utils.synchronized('smbfs', external=False)
     def create_volume_from_snapshot(self, volume, snapshot):
-        self._create_volume_from_snapshot(volume, snapshot)
+        return self._create_volume_from_snapshot(volume, snapshot)
 
     def _copy_volume_from_snapshot(self, snapshot, volume, volume_size):
         """Copy data from snapshot to destination volume.
@@ -551,7 +551,7 @@ class SmbfsDriver(remotefs_drv.RemoteFSSnapDriver):
     @utils.synchronized('smbfs', external=False)
     def create_cloned_volume(self, volume, src_vref):
         """Creates a clone of the specified volume."""
-        self._create_cloned_volume(volume, src_vref)
+        return self._create_cloned_volume(volume, src_vref)
 
     def _ensure_share_mounted(self, smbfs_share):
         mnt_flags = []