mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-18 10:04:20 +03:00
wipe_lv: close devices on error path
Device was kept open preventing its deactivated and removed on error path.
This commit is contained in:
parent
3e9664baca
commit
46d15b5e4d
@ -1,5 +1,6 @@
|
|||||||
Version 2.03.11 -
|
Version 2.03.11 -
|
||||||
==================================
|
==================================
|
||||||
|
Fix missing device closing on wiping error path.
|
||||||
Update lvmvdo man page and better explain DISCARD usage.
|
Update lvmvdo man page and better explain DISCARD usage.
|
||||||
|
|
||||||
Version 2.03.10 - 09th August 2020
|
Version 2.03.10 - 09th August 2020
|
||||||
|
@ -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,
|
if (!wipe_known_signatures(lv->vg->cmd, dev, name, 0,
|
||||||
TYPE_DM_SNAPSHOT_COW,
|
TYPE_DM_SNAPSHOT_COW,
|
||||||
wp.yes, wp.force, NULL)) {
|
wp.yes, wp.force, NULL)) {
|
||||||
|
label_scan_invalidate(dev);
|
||||||
log_error("Filed to wipe signatures of logical volume %s.",
|
log_error("Filed to wipe signatures of logical volume %s.",
|
||||||
display_lvname(lv));
|
display_lvname(lv));
|
||||||
return 0;
|
return 0;
|
||||||
@ -7659,6 +7660,7 @@ int wipe_lv(struct logical_volume *lv, struct wipe_params wp)
|
|||||||
(size_t) zero_sectors << SECTOR_SHIFT,
|
(size_t) zero_sectors << SECTOR_SHIFT,
|
||||||
(uint8_t)wp.zero_value)) ||
|
(uint8_t)wp.zero_value)) ||
|
||||||
!dev_write_zeros(dev, UINT64_C(0), (size_t) zero_sectors << SECTOR_SHIFT)) {
|
!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.",
|
log_error("Failed to initialize %s of logical volume %s with value %d.",
|
||||||
display_size(lv->vg->cmd, zero_sectors),
|
display_size(lv->vg->cmd, zero_sectors),
|
||||||
display_lvname(lv), wp.zero_value);
|
display_lvname(lv), wp.zero_value);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user