svn commit: r209704 - head/sbin/geom/class/multipath

Matt Jacob mjacob at FreeBSD.org
Sun Jul 4 22:17:57 UTC 2010


Author: mjacob
Date: Sun Jul  4 22:17:56 2010
New Revision: 209704
URL: http://svn.freebsd.org/changeset/base/209704

Log:
  Fix the clear function which has been broken for a bit.
  
  MFC after:	1 week

Modified:
  head/sbin/geom/class/multipath/geom_multipath.c

Modified: head/sbin/geom/class/multipath/geom_multipath.c
==============================================================================
--- head/sbin/geom/class/multipath/geom_multipath.c	Sun Jul  4 20:39:07 2010	(r209703)
+++ head/sbin/geom/class/multipath/geom_multipath.c	Sun Jul  4 22:17:56 2010	(r209704)
@@ -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-head mailing list