]> sourceware.org Git - lvm2.git/commitdiff
wipe_lv: always zero at least 4K
authorZdenek Kabelac <zkabelac@redhat.com>
Wed, 8 Jul 2020 08:38:36 +0000 (10:38 +0200)
committerZdenek Kabelac <zkabelac@redhat.com>
Wed, 8 Jul 2020 09:12:54 +0000 (11:12 +0200)
When zero_sectors passed value like 1 - we could zero only 1 sector.
Reinstantiate we always zero at least 4K block.

lib/metadata/lv_manip.c

index d96137afffcf73650bf1bba9042577b1c48e76cc..5956d032c106673182a9384f5c32863a9b7ce686 100644 (file)
@@ -7642,7 +7642,9 @@ int wipe_lv(struct logical_volume *lv, struct wipe_params wp)
                        if (wp.is_metadata) /* Verbosely notify metadata will not be fully zeroed */
                                log_verbose("Metadata logical volume %s not fully zeroed and may contain stale data.",
                                            display_lvname(lv));
-                       zero_sectors = wp.zero_sectors ? : UINT64_C(4096) >> SECTOR_SHIFT;
+                       zero_sectors = UINT64_C(4096) >> SECTOR_SHIFT;
+                       if (wp.zero_sectors > zero_sectors)
+                               zero_sectors = wp.zero_sectors;
 
                        if (zero_sectors > lv->size)
                                zero_sectors = lv->size;
This page took 0.046343 seconds and 5 git commands to generate.