]> sourceware.org Git - lvm2.git/commitdiff
snapshot: check merging_cow is cow
authorZdenek Kabelac <zkabelac@redhat.com>
Fri, 27 May 2016 11:49:30 +0000 (13:49 +0200)
committerZdenek Kabelac <zkabelac@redhat.com>
Fri, 27 May 2016 13:47:24 +0000 (15:47 +0200)
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.

WHATS_NEW
lib/metadata/snapshot_manip.c

index 2b6e0fb669b18176d801f47865e51e5a0ed13631..aa352a213e75ade021d8c1e07540f4f23dea1552 100644 (file)
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -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.
index 29b851f220b3aaf85192f7dd96cec1034b9560c6..2f13ac9faf1ac9152b2a42569e858baa4c0b426e 100644 (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;
This page took 0.074439 seconds and 5 git commands to generate.