diff options
author | Peter Rajnoha <prajnoha@redhat.com> | 2013-05-16 08:12:37 +0200 |
---|---|---|
committer | Peter Rajnoha <prajnoha@redhat.com> | 2013-05-16 08:17:18 +0200 |
commit | 4f6c2951d6495ee335ab69da44ae2647cd341276 (patch) | |
tree | 40e1df0337a624b61c55e05ccde9709b03462769 /lib/snapshot | |
parent | f12d88f840474a75a58d1f7ae8d391ec5852b850 (diff) | |
download | lvm2-4f6c2951d6495ee335ab69da44ae2647cd341276.tar.gz |
snapshot: fix check for snapshot-merge target presence
If calling _snap_target_present on 2nd and later call and for
a segment with MERGING flag set, we must return the status of
snapshot as well as snapshot-merge target presence, not just
the snapshot one.
Diffstat (limited to 'lib/snapshot')
-rw-r--r-- | lib/snapshot/snapshot.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/snapshot/snapshot.c b/lib/snapshot/snapshot.c index 3c03ea932..2bab9d2ea 100644 --- a/lib/snapshot/snapshot.c +++ b/lib/snapshot/snapshot.c @@ -162,9 +162,11 @@ static int _snap_target_present(struct cmd_context *cmd, _snap_checked = 1; } - if (!_snap_merge_checked && seg && (seg->status & MERGING)) { - _snap_merge_present = target_present(cmd, "snapshot-merge", 0); - _snap_merge_checked = 1; + if (seg && (seg->status & MERGING)) { + if (!_snap_merge_checked) { + _snap_merge_present = target_present(cmd, "snapshot-merge", 0); + _snap_merge_checked = 1; + } return _snap_present && _snap_merge_present; } |