From de4392314f9b0def8fab65679ec5668aec98fbee Mon Sep 17 00:00:00 2001 From: John Griffith Date: Tue, 15 Oct 2013 19:39:22 -0600 Subject: [PATCH] Don't zero out thin provisioned LV's on delete 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 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cinder/volume/drivers/lvm.py b/cinder/volume/drivers/lvm.py index 3b48840c3..75b0d3b4a 100644 --- a/cinder/volume/drivers/lvm.py +++ b/cinder/volume/drivers/lvm.py @@ -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 -- 2.45.2