All of lore.kernel.org
 help / color / mirror / Atom feed
* master - lvconvert: Fix --splitmirrors segfault with incorrect PV.
@ 2016-08-26  0:28 Alasdair Kergon
  0 siblings, 0 replies; only message in thread
From: Alasdair Kergon @ 2016-08-26  0:28 UTC (permalink / raw)
  To: lvm-devel

Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=2fde4399a01a002437d6d882c7faa59221aca93e
Commit:        2fde4399a01a002437d6d882c7faa59221aca93e
Parent:        fc93f10892187e20f9553b2d0c953cc420fd379d
Author:        Alasdair G Kergon <agk@redhat.com>
AuthorDate:    Fri Aug 26 01:21:01 2016 +0100
Committer:     Alasdair G Kergon <agk@redhat.com>
CommitterDate: Fri Aug 26 01:21:01 2016 +0100

lvconvert: Fix --splitmirrors segfault with incorrect PV.

Commit 9ee071705b2c35e1132f39f5731861c831a1bb6b misunderstood integer
promotion, but it's simpler to detect -1 more directly.
---
 WHATS_NEW                 |    1 +
 lib/metadata/raid_manip.c |    2 +-
 2 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/WHATS_NEW b/WHATS_NEW
index 99d31be..1c0bcf4 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
 Version 2.02.165 - 
 ===================================
+  Give error not segfault in lvconvert --splitmirrors when PV lies outside LV.
   Fix typo in report/columns_as_rows config option name recognition (2.02.99).
   Avoid PV tags when checking allocation against parallel PVs.
   Disallow mirror conversions of raid10 volumes.
diff --git a/lib/metadata/raid_manip.c b/lib/metadata/raid_manip.c
index d0934f4..e5fdf4f 100644
--- a/lib/metadata/raid_manip.c
+++ b/lib/metadata/raid_manip.c
@@ -1497,7 +1497,7 @@ int lv_raid_split_and_track(struct logical_volume *lv,
 		break;
 	}
 
-	if (s >= (int) seg->area_count) {
+	if (s < 0) {
 		log_error("Unable to find image to satisfy request");
 		return 0;
 	}



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2016-08-26  0:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-26  0:28 master - lvconvert: Fix --splitmirrors segfault with incorrect PV Alasdair Kergon

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.