diff options
author | Zdenek Kabelac <zkabelac@redhat.com> | 2016-12-14 21:47:38 +0100 |
---|---|---|
committer | Zdenek Kabelac <zkabelac@redhat.com> | 2016-12-18 19:10:38 +0100 |
commit | bdfc96cb089031c6d95dccb0ff66616efdb16783 (patch) | |
tree | 6f06b33ce7e873a226a6f439aeadf65ff1abaa17 | |
parent | a15f0d181ca2fb44c9c854dfba425d372a8756c6 (diff) | |
download | lvm2-bdfc96cb089031c6d95dccb0ff66616efdb16783.tar.gz |
raid: fix activation of tracked image
Activation of raid has brough up also splitted image with tracing
(without taking lock for this).
So when raid is now activate - such image is not put into
table (with _rmeta). When user needs such device, just active it.
-rw-r--r-- | WHATS_NEW | 3 | ||||
-rw-r--r-- | lib/activate/dev_manager.c | 3 | ||||
-rw-r--r-- | lib/metadata/metadata-exported.h | 1 |
3 files changed, 6 insertions, 1 deletions
@@ -1,8 +1,9 @@ Version 2.02.169 - ===================================== + Fix table load for splitted RAID LV and require explicit activation. Always active splitted RAID LV exclusively locally. Do not use LV RAID status bit for segment status. - Check segtype directly instead of checking RAID in segment status. + Check segtype directly instead of checking RAID in segment status. Reusing exiting code for raid image removal. Fix pvmove leaving -pvmove0 error device in clustered VG. Avoid adding extra '_' at end of raid extracted images or metadata. diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c index 581e90088..8245454db 100644 --- a/lib/activate/dev_manager.c +++ b/lib/activate/dev_manager.c @@ -2681,12 +2681,15 @@ static int _add_segment_to_dtree(struct dev_manager *dm, /* Add any LVs used by this segment */ for (s = 0; s < seg->area_count; ++s) { if ((seg_type(seg, s) == AREA_LV) && + /* do not bring up tracked image */ + !lv_is_raid_image_with_tracking(seg_lv(seg, s)) && /* origin only for cache without pending delete */ (!dm->track_pending_delete || !seg_is_cache(seg)) && !_add_new_lv_to_dtree(dm, dtree, seg_lv(seg, s), laopts, NULL)) return_0; if (seg_is_raid_with_meta(seg) && seg->meta_areas && seg_metalv(seg, s) && + !lv_is_raid_image_with_tracking(seg_lv(seg, s)) && !_add_new_lv_to_dtree(dm, dtree, seg_metalv(seg, s), laopts, NULL)) return_0; diff --git a/lib/metadata/metadata-exported.h b/lib/metadata/metadata-exported.h index 4bf466b1f..aa40c6c1e 100644 --- a/lib/metadata/metadata-exported.h +++ b/lib/metadata/metadata-exported.h @@ -226,6 +226,7 @@ #define lv_is_raid(lv) (((lv)->status & RAID) ? 1 : 0) #define lv_is_raid_image(lv) (((lv)->status & RAID_IMAGE) ? 1 : 0) +#define lv_is_raid_image_with_tracking(lv) ((lv_is_raid_image(lv) && !((lv)->status & LVM_WRITE)) ? 1 : 0) #define lv_is_raid_metadata(lv) (((lv)->status & RAID_META) ? 1 : 0) #define lv_is_raid_type(lv) (((lv)->status & (RAID | RAID_IMAGE | RAID_META)) ? 1 : 0) |