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

snapshot: check merging_cow is cow

Check first the LV is cow before even checking it's a merging COW.
Note: previosly merging_cow was also merging origin, so without
this explicit check it used to return '1' also when passed
LV has been merging origin.
This commit is contained in:
Zdenek Kabelac 2016-05-27 13:49:30 +02:00
parent e9ee2cb6b6
commit 26889b3bb6
2 changed files with 7 additions and 1 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.155 -
================================
When checking LV is a merging COW, validate its a COW LV first.
Correcting value in copy_percent() for 100%.
Update vgreduce to use process_each_vg.
Update lvconvert to use process_each_lv.

View File

@ -139,7 +139,12 @@ int lv_is_visible(const struct logical_volume *lv)
int lv_is_merging_cow(const struct logical_volume *cow)
{
struct lv_segment *snap_seg = find_snapshot(cow);
struct lv_segment *snap_seg;
if (!lv_is_cow(cow))
return 0;
snap_seg = find_snapshot(cow);
/* checks lv_segment's status to see if snapshot is merging */
return (snap_seg && (snap_seg->status & MERGING)) ? 1 : 0;