]> sourceware.org Git - lvm2.git/commitdiff
Changing RAID status flags to 64-bit broke some binary flag operations.
authorJonathan Earl Brassow <jbrassow@redhat.com>
Tue, 13 Sep 2011 16:33:21 +0000 (16:33 +0000)
committerJonathan Earl Brassow <jbrassow@redhat.com>
Tue, 13 Sep 2011 16:33:21 +0000 (16:33 +0000)
LVM_WRITE is a 32-bit flag.  Now that RAID[_IMAGE|_META] are 64-bit,
and'ing a RAID LV's status against LVM_WRITE can reset the higher order
flags.

A similar thing will affect thinp flags if not careful.

WHATS_NEW
lib/metadata/raid_manip.c

index 77de51f7caef26754814c8da26e2b53b799ac2da..b7a4994707d898109d05238bbc8f6e4ab223209e 100644 (file)
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
 Version 2.02.89 - 
 ==================================
+  Fix improper RAID 64-bit status flag reset when and'ing against 32-bit flag.
   Fix log size calculation when only a log is being added to a mirror.
   Work around resume_lv causing error LV scanning during splitmirror operation.
   Add 7th lv_attr char to show the related kernel target.
index 19808184e368b6f9b1b44d387b2a389957bb05f0..d1e400262adc38bcf51c631b480cb5242d91d74d 100644 (file)
@@ -971,7 +971,11 @@ int lv_raid_split_and_track(struct logical_volume *lv,
                if (!_lv_is_on_pvs(seg_lv(seg, s), splittable_pvs))
                        continue;
                lv_set_visible(seg_lv(seg, s));
-               seg_lv(seg, s)->status &= ~LVM_WRITE;
+               /*
+                * LVM_WRITE is 32-bit, if we don't '|' it with
+                * UINT64_C(0) it will remove all higher order flags
+                */
+               seg_lv(seg, s)->status &= ~(UINT64_C(0) | LVM_WRITE);
                break;
        }
 
This page took 0.041826 seconds and 5 git commands to generate.