Date: Thu, 12 May 2016 15:31:58 +0000 (UTC) From: Alan Somers <asomers@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r299536 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs Message-ID: <201605121531.u4CFVwOm054172@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: asomers Date: Thu May 12 15:31:58 2016 New Revision: 299536 URL: https://svnweb.freebsd.org/changeset/base/299536 Log: MFC r297986, r298017 to vdev_geom.c r297986 | asomers | 2016-04-14 13:20:31 -0600 (Thu, 14 Apr 2016) | 6 lines Update a debugging message in vdev_geom_open_by_guids for consistency with similar messages elsewhere in the file. r298017 | asomers | 2016-04-14 17:14:41 -0600 (Thu, 14 Apr 2016) | 8 lines 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 Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Thu May 12 15:24:36 2016 (r299535) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Thu May 12 15:31:58 2016 (r299536) @@ -158,6 +158,7 @@ vdev_geom_attach(struct g_provider *pp, { struct g_geom *gp; struct g_consumer *cp; + int error; g_topology_assert(); @@ -175,11 +176,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); } @@ -194,19 +201,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); } } @@ -622,7 +639,8 @@ vdev_geom_open_by_guids(vdev_t *vd) g_topology_assert(); - ZFS_LOG(1, "Searching by guid [%ju].", (uintmax_t)vd->vdev_guid); + ZFS_LOG(1, "Searching by guids [%ju:%ju].", + (uintmax_t)spa_guid(vd->vdev_spa), (uintmax_t)vd->vdev_guid); cp = vdev_geom_attach_by_guids(vd); if (cp != NULL) { len = strlen(cp->provider->name) + strlen("/dev/") + 1;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201605121531.u4CFVwOm054172>