From 8d20a52909cad330e23205cdc1685bd0bdd7c4f7 Mon Sep 17 00:00:00 2001
From: mav <mav@FreeBSD.org>
Date: Fri, 27 Jan 2017 05:59:26 +0000
Subject: MFC r312533: Report disk addition errors on `add` or `create`
 subcommand.

---
 sys/geom/multipath/g_multipath.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

(limited to 'sys/geom/multipath/g_multipath.c')

diff --git a/sys/geom/multipath/g_multipath.c b/sys/geom/multipath/g_multipath.c
index b461747..0c24cd3 100644
--- a/sys/geom/multipath/g_multipath.c
+++ b/sys/geom/multipath/g_multipath.c
@@ -923,6 +923,7 @@ g_multipath_ctl_add_name(struct gctl_req *req, struct g_class *mp,
 	struct g_provider *pp;
 	const char *mpname;
 	static const char devpf[6] = "/dev/";
+	int error;
 
 	g_topology_assert();
 
@@ -972,10 +973,9 @@ g_multipath_ctl_add_name(struct gctl_req *req, struct g_class *mp,
 		return;
 	}
 
-	/*
-	 * Now add....
-	 */
-	(void) g_multipath_add_disk(gp, pp);
+	error = g_multipath_add_disk(gp, pp);
+	if (error != 0)
+		gctl_error(req, "Provider addition error: %d", error);
 }
 
 static void
-- 
cgit v1.1