]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Don't zero out thin provisioned LV's on delete
authorJohn Griffith <john.griffith@solidfire.com>
Wed, 16 Oct 2013 01:39:22 +0000 (19:39 -0600)
committerJohn Griffith <john.griffith@solidfire.com>
Wed, 16 Oct 2013 03:13:23 +0000 (21:13 -0600)
Thin provisioned LV's don't need secure delete to protect
from data leakage.  Also, zeroing these out kinda defeats
the purpose of using thing provisioning.

This patch add a check for the lvm type and if it's thin simply
returns from the lvm.clear_volume() method.

Change-Id: Ie6764209018152565295291efc6fbba553698ae6
Closes-Bug: #1240299

cinder/volume/drivers/lvm.py

index 3b48840c3e56a00839be238c6b44dbbb8de80dc9..75b0d3b4aaf057de998f37f4999100a53f4c8dc6 100644 (file)
@@ -197,10 +197,13 @@ class LVMVolumeDriver(driver.VolumeDriver):
     def clear_volume(self, volume, is_snapshot=False):
         """unprovision old volumes to prevent data leaking between users."""
 
-        if self.configuration.volume_clear == 'none':
+        # NOTE(jdg): Don't write the blocks of thin provisioned
+        # volumes
+        if self.configuration.volume_clear == 'none' or \
+                self.configuration.lvm_type == 'thin':
             return
 
-        if is_snapshot and not self.configuration.lvm_type == 'thin':
+        if is_snapshot:
             # if the volume to be cleared is a snapshot of another volume
             # we need to clear out the volume using the -cow instead of the
             # directly volume path.  We need to skip this if we are using