[lvm-devel] master - RAID: Don't allow syncaction changes on non-RAID LVs

Jonathan Brassow jbrassow at fedoraproject.org
Fri Sep 20 03:34:32 UTC 2013


Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=2c41c8b88610bff6a3352b93f6b5c70a3744c817
Commit:        2c41c8b88610bff6a3352b93f6b5c70a3744c817
Parent:        25bed9968155f43ef0b8832383ef711e7ae1685d
Author:        Jonathan Brassow <jbrassow at redhat.com>
AuthorDate:    Thu Sep 19 22:33:01 2013 -0500
Committer:     Jonathan Brassow <jbrassow at redhat.com>
CommitterDate: Thu Sep 19 22:33:01 2013 -0500

RAID: Don't allow syncaction changes on non-RAID LVs

Don't allow syncaction or other RAID-type messages on non-RAID
logical volumes.
---
 lib/activate/activate.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/lib/activate/activate.c b/lib/activate/activate.c
index e5033c6..7b535c6 100644
--- a/lib/activate/activate.c
+++ b/lib/activate/activate.c
@@ -896,6 +896,12 @@ int lv_raid_message(const struct logical_volume *lv, const char *msg)
 	struct dev_manager *dm;
 	struct dm_status_raid *status;
 
+	if (!seg_is_raid(first_seg(lv))) {
+		log_error("%s/%s must be a RAID logical volume to"
+			  " perform this action.", lv->vg->name, lv->name);
+		return 0;
+	}
+
 	if (!lv_is_active_locally(lv)) {
 		log_error("Unable to send message to an inactive logical volume.");
 		return 0;




More information about the lvm-devel mailing list