Date: Sun, 4 Jul 2010 22:17:57 +0000 (UTC) From: Matt Jacob <mjacob@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r209704 - head/sbin/geom/class/multipath Message-ID: <201007042217.o64MHv3l061519@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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; + } } }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201007042217.o64MHv3l061519>