svn commit: r215916 - stable/8/sbin/geom/class/multipath

Matt Jacob mjacob at FreeBSD.org
Sat Nov 27 00:23:56 UTC 2010


Author: mjacob
Date: Sat Nov 27 00:23:55 2010
New Revision: 215916
URL: http://svn.freebsd.org/changeset/base/215916

Log:
  MFC of 209704.
  
  Fix the clear function which has been broken for a bit.

Modified:
  stable/8/sbin/geom/class/multipath/geom_multipath.c
Directory Properties:
  stable/8/sbin/geom/class/multipath/   (props changed)

Modified: stable/8/sbin/geom/class/multipath/geom_multipath.c
==============================================================================
--- stable/8/sbin/geom/class/multipath/geom_multipath.c	Sat Nov 27 00:04:29 2010	(r215915)
+++ stable/8/sbin/geom/class/multipath/geom_multipath.c	Sat Nov 27 00:23:55 2010	(r215916)
@@ -222,17 +222,28 @@ mp_label(struct gctl_req *req)
 	}
 }
 
+
 static void
 mp_clear(struct gctl_req *req)
 {
 	const char *name;
-	int error;
+	int error, i, nargs;
+
+	nargs = gctl_get_int(req, "nargs");
+	if (nargs < 1) {
+		gctl_error(req, "Too few arguments.");
+		return;
+	}
 
-	name = gctl_get_ascii(req, "arg1");
-	error = g_metadata_clear(name, G_MULTIPATH_MAGIC);
-	if (error != 0) {
-		fprintf(stderr, "Can't clear metadata on %s: %s.\n", name, strerror(error));
-		gctl_error(req, "Not fully done.");
+	for (i = 0; i < nargs; i++) {
+		name = gctl_get_ascii(req, "arg%d", i);
+		error = g_metadata_clear(name, G_MULTIPATH_MAGIC);
+		if (error != 0) {
+			fprintf(stderr, "Can't clear metadata on %s: %s.\n",
+			    name, strerror(error));
+			gctl_error(req, "Not fully done.");
+			continue;
+		}
 	}
 }
 


More information about the svn-src-all mailing list