[lvm-devel] master - allocation: add check for passing log allocation

Zdenek Kabelac zkabelac at sourceware.org
Sun Jul 8 23:00:33 UTC 2018


Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=e9d1f676b3768844471f8c6d3345a1b60bc2c94e
Commit:        e9d1f676b3768844471f8c6d3345a1b60bc2c94e
Parent:        333eb8667e73439c71dc351a02612c1c7601e8ec
Author:        Zdenek Kabelac <zkabelac at redhat.com>
AuthorDate:    Mon Jul 9 00:54:16 2018 +0200
Committer:     Zdenek Kabelac <zkabelac at redhat.com>
CommitterDate: Mon Jul 9 00:59:34 2018 +0200

allocation: add check for passing log allocation

Updates previous commit.
---
 lib/metadata/lv_manip.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index 7674a3e..6bf851e 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -2966,7 +2966,9 @@ static int _find_some_parallel_space(struct alloc_handle *ah,
 		       (*(alloc_state->areas + alloc_state->num_positional_areas + ix - 1 -
 			  too_small_for_log_count)).used < ah->log_len)
 			too_small_for_log_count++;
-		if (ah->mirror_logs_separate && (too_small_for_log_count >= devices_needed))
+		if (ah->mirror_logs_separate &&
+		    too_small_for_log_count &&
+		    (too_small_for_log_count >= devices_needed))
 			return 1;
 		if ((alloc_state->num_positional_areas + ix) < (too_small_for_log_count + ah->log_area_count))
 			return 1;




More information about the lvm-devel mailing list