From d954a7f99111ebe6b44bc6d6baa2f56344a8b349 Mon Sep 17 00:00:00 2001 From: Jonathan Earl Brassow Date: Tue, 13 Sep 2011 16:33:21 +0000 Subject: [PATCH] Changing RAID status flags to 64-bit broke some binary flag operations. 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 | 1 + lib/metadata/raid_manip.c | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/WHATS_NEW b/WHATS_NEW index 77de51f7c..b7a499470 100644 --- 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. diff --git a/lib/metadata/raid_manip.c b/lib/metadata/raid_manip.c index 19808184e..d1e400262 100644 --- a/lib/metadata/raid_manip.c +++ b/lib/metadata/raid_manip.c @@ -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; } -- 2.43.5