diff options
author | asomers <asomers@FreeBSD.org> | 2016-04-14 23:14:41 +0000 |
---|---|---|
committer | asomers <asomers@FreeBSD.org> | 2016-04-14 23:14:41 +0000 |
commit | 0ee7b1f1ff956c9dd0081b2cf1e837a2dd80d00f (patch) | |
tree | dc1ea6f13674e53658b4135511de1dc93e5a5303 /sys/cddl | |
parent | 4d9b1f8309d402ff30a915a7e44f5a9a185b2ef2 (diff) | |
download | FreeBSD-src-0ee7b1f1ff956c9dd0081b2cf1e837a2dd80d00f.zip FreeBSD-src-0ee7b1f1ff956c9dd0081b2cf1e837a2dd80d00f.tar.gz |
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
Diffstat (limited to 'sys/cddl')
-rw-r--r-- | sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c index edea99f..bc63fe9 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c @@ -163,6 +163,7 @@ vdev_geom_attach(struct g_provider *pp, vdev_t *vd) { struct g_geom *gp; struct g_consumer *cp; + int error; g_topology_assert(); @@ -180,11 +181,17 @@ vdev_geom_attach(struct g_provider *pp, vdev_t *vd) 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, vdev_t *vd) } 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); } } |