[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[lvm-devel] [PATCH] Complain when lvconvert --repair is used on non-mirror LV.


just a trivial patch to make things clear when people mistakenly run lvconvert
--repair on a non-mirrored LV (otherwise, this would succeed silently doing

diff -rN -u -p old-upstream/tools/lvconvert.c new-upstream/tools/lvconvert.c
--- old-upstream/tools/lvconvert.c	2009-06-10 07:43:14.313576176 +0200
+++ new-upstream/tools/lvconvert.c	2009-06-10 07:43:15.021578519 +0200
@@ -894,6 +894,11 @@ static int lvconvert_single(struct cmd_c
 		return ECMD_FAILED;
+	if (arg_count(cmd, repair_ARG) && !(lv->status & MIRRORED)) {
+		log_error("Can't repair non-mirrored LV \"%s\".", lv->name);
+		return ECMD_FAILED;
+	}
 	if (lp->snapshot) {
 		if (lv->status & MIRRORED) {
 			log_error("Unable to convert mirrored LV \"%s\" into a snapshot.", lv->name);

Peter Rockai | me()mornfall!net | prockai()redhat!com
 http://blog.mornfall.net | http://web.mornfall.net

"In My Egotistical Opinion, most people's C programs should be
 indented six feet downward and covered with dirt."
     -- Blair P. Houghton on the subject of C program indentation

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]