]> sourceware.org Git - lvm2.git/commitdiff
wipe_lv: close devices on error path
authorZdenek Kabelac <zkabelac@redhat.com>
Wed, 19 Aug 2020 12:40:08 +0000 (14:40 +0200)
committerZdenek Kabelac <zkabelac@redhat.com>
Wed, 19 Aug 2020 13:09:09 +0000 (15:09 +0200)
Device was kept open preventing its deactivated and removed
on error path.

WHATS_NEW
lib/metadata/lv_manip.c

index f3cb50692f2005788cb5be3ffd73ad659e54340c..cdc491c83edd399895c7d56a7251267d3ba983d3 100644 (file)
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
 Version 2.03.11 - 
 ==================================
+  Fix missing device closing on wiping error path.
   Update lvmvdo man page and better explain DISCARD usage.
 
 Version 2.03.10 - 09th August 2020
index f0ba3f0db34288758a29ebba5957633ca0528df3..bb2ad5beb34034ed409096a14eaf68571848a69a 100644 (file)
@@ -7625,6 +7625,7 @@ int wipe_lv(struct logical_volume *lv, struct wipe_params wp)
                if (!wipe_known_signatures(lv->vg->cmd, dev, name, 0,
                                           TYPE_DM_SNAPSHOT_COW,
                                           wp.yes, wp.force, NULL)) {
+                       label_scan_invalidate(dev);
                        log_error("Filed to wipe signatures of logical volume %s.",
                                  display_lvname(lv));
                        return 0;
@@ -7659,6 +7660,7 @@ int wipe_lv(struct logical_volume *lv, struct wipe_params wp)
                                                     (size_t) zero_sectors << SECTOR_SHIFT,
                                                     (uint8_t)wp.zero_value)) ||
                    !dev_write_zeros(dev, UINT64_C(0), (size_t) zero_sectors << SECTOR_SHIFT)) {
+                       label_scan_invalidate(dev);
                        log_error("Failed to initialize %s of logical volume %s with value %d.",
                                  display_size(lv->vg->cmd, zero_sectors),
                                  display_lvname(lv), wp.zero_value);
This page took 0.064241 seconds and 5 git commands to generate.