diff options
author | Alasdair G Kergon <agk@redhat.com> | 2016-05-23 22:55:13 +0100 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2016-05-23 22:55:13 +0100 |
commit | b896f7de1e6773ce6c17bf29a9123276695f4b60 (patch) | |
tree | 81416375ce783c38667cc210f83470848b2e83f5 /tools/vgsplit.c | |
parent | 757f7d55082844a17372e4e83c6a95884c2550a8 (diff) | |
download | lvm2-b896f7de1e6773ce6c17bf29a9123276695f4b60.tar.gz |
raid0: Standardise meta_areas checks before access.
Diffstat (limited to 'tools/vgsplit.c')
-rw-r--r-- | tools/vgsplit.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/vgsplit.c b/tools/vgsplit.c index 8335570bc..e7c6e191b 100644 --- a/tools/vgsplit.c +++ b/tools/vgsplit.c @@ -253,11 +253,11 @@ static int _move_raid(struct volume_group *vg_from, for (s = 0; s < seg->area_count; s++) { if (_lv_is_in_vg(vg_to, seg_lv(seg, s))) seg_in++; - if (_lv_is_in_vg(vg_to, seg_metalv(seg, s))) - seg_in++; + if (seg->meta_areas && seg_metalv(seg, s) && _lv_is_in_vg(vg_to, seg_metalv(seg, s))) + seg_in++; /* FIXME Inadequate - must count separately */ } - if (seg_in && seg_in != (seg->area_count * 2)) { + if (seg_in && seg_in != (seg->area_count * (seg->meta_areas ? 2 : 1))) { log_error("Can't split RAID %s between " "two Volume Groups", lv->name); return 0; |