Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Apr 2016 23:14:41 +0000 (UTC)
From:      Alan Somers <asomers@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r298017 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Message-ID:  <201604142314.u3ENEftq079214@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: asomers
Date: Thu Apr 14 23:14:41 2016
New Revision: 298017
URL: https://svnweb.freebsd.org/changeset/base/298017

Log:
  Add more debugging statements in vdev_geom.c
  
  Log a debugging message whenever geom functions fail in vdev_geom_attach.
  Printing these messages is controlled by vfs.zfs.debug
  
  MFC after:	4 weeks
  Sponsored by:	Spectra Logic Corp

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c	Thu Apr 14 22:51:23 2016	(r298016)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c	Thu Apr 14 23:14:41 2016	(r298017)
@@ -163,6 +163,7 @@ vdev_geom_attach(struct g_provider *pp, 
 {
 	struct g_geom *gp;
 	struct g_consumer *cp;
+	int error;
 
 	g_topology_assert();
 
@@ -180,11 +181,17 @@ vdev_geom_attach(struct g_provider *pp, 
 		gp->orphan = vdev_geom_orphan;
 		gp->attrchanged = vdev_geom_attrchanged;
 		cp = g_new_consumer(gp);
-		if (g_attach(cp, pp) != 0) {
+		error = g_attach(cp, pp);
+		if (error != 0) {
+			ZFS_LOG(1, "%s(%d): g_attach failed: %d\n", __func__,
+			    __LINE__, error);
 			g_wither_geom(gp, ENXIO);
 			return (NULL);
 		}
-		if (g_access(cp, 1, 0, 1) != 0) {
+		error = g_access(cp, 1, 0, 1);
+		if (error != 0) {
+			ZFS_LOG(1, "%s(%d): g_access failed: %d\n", __func__,
+			       __LINE__, error);
 			g_wither_geom(gp, ENXIO);
 			return (NULL);
 		}
@@ -199,19 +206,29 @@ vdev_geom_attach(struct g_provider *pp, 
 		}
 		if (cp == NULL) {
 			cp = g_new_consumer(gp);
-			if (g_attach(cp, pp) != 0) {
+			error = g_attach(cp, pp);
+			if (error != 0) {
+				ZFS_LOG(1, "%s(%d): g_attach failed: %d\n",
+				    __func__, __LINE__, error);
 				g_destroy_consumer(cp);
 				return (NULL);
 			}
-			if (g_access(cp, 1, 0, 1) != 0) {
+			error = g_access(cp, 1, 0, 1);
+			if (error != 0) {
+				ZFS_LOG(1, "%s(%d): g_access failed: %d\n",
+				    __func__, __LINE__, error);
 				g_detach(cp);
 				g_destroy_consumer(cp);
 				return (NULL);
 			}
 			ZFS_LOG(1, "Created consumer for %s.", pp->name);
 		} else {
-			if (g_access(cp, 1, 0, 1) != 0)
+			error = g_access(cp, 1, 0, 1);
+			if (error != 0) {
+				ZFS_LOG(1, "%s(%d): g_access failed: %d\n",
+				    __func__, __LINE__, error);
 				return (NULL);
+			}
 			ZFS_LOG(1, "Used existing consumer for %s.", pp->name);
 		}
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201604142314.u3ENEftq079214>