]> sourceware.org Git - lvm2.git/commitdiff
Wipe initial 4KiB for non-zeroed thin volumes
authorZdenek Kabelac <zkabelac@redhat.com>
Wed, 29 Feb 2012 22:08:57 +0000 (22:08 +0000)
committerZdenek Kabelac <zkabelac@redhat.com>
Wed, 29 Feb 2012 22:08:57 +0000 (22:08 +0000)
If the thin pool has disabled zeroing  (created with -Zn), we at least
clear initial 4KiB of such thin volume (provisions 1st block).

If lvcreate is executed with '-an' command will abort (same way like we for
normal LV - however for normal LV option -Zn may skip clearing completely,
for thin volumes this option is not supported (applies only for pools).

WHATS_NEW
lib/metadata/lv_manip.c

index c3657452ee26d3cd7640992be00821a1d474de7c..82f964fc24ba04ea1b29241b87e3e548fa91b3eb 100644 (file)
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
 Version 2.02.94 - 
 ====================================
+  Use set_lv() (wipe initial 4KiB) for non zeroed thin volume.
   Allow cluster mirrors to handle the absence of the checkpoint lib (libSaCkpt).
   Revert free of allocated segtype in init segment error path (2.02.89).
   Test dm_hash_insert() failures in filter-persistent.c and fid_add_mda().
index 82f3c65f9e4f97d660d5007db258f8e46cefdc09..513590f71e86db5c6bfd5c452627bbbf4b2c5d8f 100644 (file)
@@ -4457,7 +4457,10 @@ static struct logical_volume *_lv_create_an_lv(struct volume_group *vg, struct l
 
        if (!seg_is_thin(lp) && !lp->zero && !lp->snapshot)
                log_warn("WARNING: \"%s\" not zeroed", lv->name);
-       else if (!seg_is_thin(lp) && !set_lv(cmd, lv, UINT64_C(0), 0)) {
+       else if ((!seg_is_thin(lp) ||
+                 (lv_is_thin_volume(lv) &&
+                  !first_seg(first_seg(lv)->pool_lv)->zero_new_blocks)) &&
+                !set_lv(cmd, lv, UINT64_C(0), 0)) {
                log_error("Aborting. Failed to wipe %s.",
                          lp->snapshot ? "snapshot exception store" :
                                         "start of new LV");
This page took 0.041759 seconds and 5 git commands to generate.