mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
format1: Fix snapshot reload in lv_remove.
The special suspend/resume code in lv_remove for LVM1 snapshots was interpsersed with a vg_commit call. However, while with LVM1 metadata, vg_commit is technically a no-op, the activation code relied on the ondisk and incore metadata being the same, since on LVM1, a "commit" happens in vg_write already. Since the "ondisk" metadata was previously not available with format1 (and incore was silently used instead, via lvmcache), the problem was masked.
This commit is contained in:
parent
7d644443e0
commit
f5a3bef276
@ -3557,20 +3557,18 @@ int lv_remove_single(struct cmd_context *cmd, struct logical_volume *lv,
|
||||
}
|
||||
|
||||
/* store it on disks */
|
||||
if (!vg_write(vg))
|
||||
if (!vg_write(vg) || !vg_commit(vg))
|
||||
return_0;
|
||||
|
||||
/* format1 */
|
||||
if (format1_reload_required && !suspend_lv(cmd, format1_origin))
|
||||
log_error("Failed to refresh %s without snapshot.", format1_origin->name);
|
||||
if (format1_reload_required) {
|
||||
if (!suspend_lv(cmd, format1_origin))
|
||||
log_error("Failed to refresh %s without snapshot.", format1_origin->name);
|
||||
|
||||
if (!vg_commit(vg))
|
||||
return_0;
|
||||
|
||||
/* format1 */
|
||||
if (format1_reload_required && !resume_lv(cmd, format1_origin)) {
|
||||
log_error("Failed to resume %s.", format1_origin->name);
|
||||
return 0;
|
||||
if (!resume_lv(cmd, format1_origin)) {
|
||||
log_error("Failed to resume %s.", format1_origin->name);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* Release unneeded blocks in thin pool */
|
||||
|
Loading…
Reference in New Issue
Block a user