diff options
author | Alasdair G Kergon <agk@redhat.com> | 2016-09-16 02:11:58 +0100 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2016-09-16 02:11:58 +0100 |
commit | 9c8c8fb63abd1a36b9c448450c9cccfac4c0299e (patch) | |
tree | bda3db2f046a3c12dca513f1b02559de3ca88569 | |
parent | 5da35d879ad073d9fb0d7ec8bfabe9ae39ac5bc1 (diff) | |
download | lvm2-9c8c8fb63abd1a36b9c448450c9cccfac4c0299e.tar.gz |
alloc: Use --alloc normal for mirror logs.
The existing code doesn't understand that mirror logs should cling to
parallel LVs (like extending them) instead of avoiding them.
As a quick workaround to avoid lvcreate failures, hard-code
--alloc normal for mirror logs even if the rest of the allocation
used a stricter policy.
https://bugzilla.redhat.com/show_bug.cgi?id=1376532
-rw-r--r-- | WHATS_NEW | 1 | ||||
-rw-r--r-- | lib/metadata/lv_manip.c | 9 |
2 files changed, 10 insertions, 0 deletions
@@ -1,5 +1,6 @@ Version 2.02.166 - ===================================== + Use --alloc normal for mirror logs even if the mimages were stricter. Use O_DIRECT to gather metadata in lvmdump. Fix possible NULL pointer derefence when checking for monitoring. Add lvmreport(7) man page. diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c index dcc8d860f..d6869e18c 100644 --- a/lib/metadata/lv_manip.c +++ b/lib/metadata/lv_manip.c @@ -3085,6 +3085,15 @@ static int _allocate(struct alloc_handle *ah, if (!_find_max_parallel_space_for_one_policy(ah, &alloc_parms, pvms, &alloc_state)) goto_out; + /* As a workaround, if only the log is missing now, fall through and try later policies up to normal. */ + /* FIXME Change the core algorithm so the log extents cling to parallel LVs instead of avoiding them. */ + if (alloc_state.allocated == ah->new_extents && + alloc_state.log_area_count_still_needed && + ah->alloc < ALLOC_NORMAL) { + ah->alloc = ALLOC_NORMAL; + continue; + } + if ((alloc_state.allocated == ah->new_extents && !alloc_state.log_area_count_still_needed) || (!can_split && (alloc_state.allocated != old_allocated))) |