1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

cleanup: lvchange remove some extra code.

We do not need to restore LV content on error path - since
for reactivation we always use  ondisk/commited metadata,
so passed data are never used.

Drop some unneded extra message, since the called function
repeated logs same info.
This commit is contained in:
Zdenek Kabelac 2014-09-19 15:10:21 +02:00
parent 3adc50ac22
commit 702b648215

View File

@ -399,19 +399,8 @@ static int lvchange_resync(struct cmd_context *cmd, struct logical_volume *lv)
return 0;
}
if (!vg_write(lv->vg)) {
log_error("Failed to write intermediate VG metadata.");
if (!attach_metadata_devices(seg, &device_list))
stack;
if (!_reactivate_lv(lv, active, exclusive))
stack;
return 0;
}
if (!vg_commit(lv->vg)) {
log_error("Failed to commit intermediate VG metadata.");
if (!attach_metadata_devices(seg, &device_list))
stack;
if (!vg_write(lv->vg) || !vg_commit(lv->vg)) {
log_error("Failed to update intermediate VG metadata on disk.");
if (!_reactivate_lv(lv, active, exclusive))
stack;
return 0;
@ -428,10 +417,6 @@ static int lvchange_resync(struct cmd_context *cmd, struct logical_volume *lv)
return 0;
}
log_very_verbose("Clearing %s device %s",
(seg_is_raid(seg)) ? "metadata" : "log",
lvl->lv->name);
if (!wipe_lv(lvl->lv, (struct wipe_params)
{ .do_zero = 1, .zero_sectors = lvl->lv->size })) {
log_error("Unable to reset sync status for %s",
@ -460,7 +445,6 @@ static int lvchange_resync(struct cmd_context *cmd, struct logical_volume *lv)
return 0;
}
log_very_verbose("Updating logical volume \"%s\" on disk(s)", lv->name);
if (!vg_write(lv->vg) || !vg_commit(lv->vg)) {
log_error("Failed to update metadata on disk.");
return 0;