1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-03 05:18:29 +03:00

Do not reload origin again in lv_remove_single() if it had a merging

snapshot.  vg_remove_snapshot() will have already performed the required
reload.
This commit is contained in:
Mike Snitzer 2010-02-17 23:36:45 +00:00
parent a5ec3e3827
commit 4bdebfd151

View File

@ -2064,6 +2064,7 @@ int lv_remove_single(struct cmd_context *cmd, struct logical_volume *lv,
struct volume_group *vg;
struct lvinfo info;
struct logical_volume *origin = NULL;
int was_merging = 0;
vg = lv->vg;
@ -2118,6 +2119,7 @@ int lv_remove_single(struct cmd_context *cmd, struct logical_volume *lv,
if (lv_is_cow(lv)) {
origin = origin_from_cow(lv);
was_merging = lv_is_merging_origin(origin);
log_verbose("Removing snapshot %s", lv->name);
/* vg_remove_snapshot() will preload origin if it was merging */
if (!vg_remove_snapshot(lv))
@ -2140,8 +2142,8 @@ int lv_remove_single(struct cmd_context *cmd, struct logical_volume *lv,
if (!vg_write(vg) || !vg_commit(vg))
return_0;
/* If no snapshots left, reload without -real. */
if (origin && (!lv_is_origin(origin))) {
/* If no snapshots left, and was not merging, reload without -real. */
if (origin && (!lv_is_origin(origin) && !was_merging)) {
if (!suspend_lv(cmd, origin)) {
log_error("Failed to refresh %s without snapshot.", origin->name);
return 0;