diff options
author | mdf <mdf@FreeBSD.org> | 2010-09-10 16:42:16 +0000 |
---|---|---|
committer | mdf <mdf@FreeBSD.org> | 2010-09-10 16:42:16 +0000 |
commit | ab3a8b533a824bceba3baf79642745d2b57f4c9d (patch) | |
tree | e9bea66185b980482df09793bce47717d6df59f2 /sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fm.c | |
parent | d0cd039a30daea0e7c8a5089793befb261d13de1 (diff) | |
download | FreeBSD-src-ab3a8b533a824bceba3baf79642745d2b57f4c9d.zip FreeBSD-src-ab3a8b533a824bceba3baf79642745d2b57f4c9d.tar.gz |
Replace sbuf_overflowed() with sbuf_error(), which returns any error
code associated with overflow or with the drain function. While this
function is not expected to be used often, it produces more information
in the form of an errno that sbuf_overflowed() did.
Diffstat (limited to 'sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fm.c')
-rw-r--r-- | sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fm.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fm.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fm.c index 63ae13a..cf2f90d 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fm.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fm.c @@ -101,6 +101,7 @@ zfs_ereport_post(const char *subclass, spa_t *spa, vdev_t *vd, zio_t *zio, char buf[1024]; struct sbuf sb; struct timespec ts; + int error; /* * If we are doing a spa_tryimport(), ignore errors. @@ -315,9 +316,9 @@ zfs_ereport_post(const char *subclass, spa_t *spa, vdev_t *vd, zio_t *zio, } mutex_exit(&spa->spa_errlist_lock); - sbuf_finish(&sb); + error = sbuf_finish(&sb); devctl_notify("ZFS", spa->spa_name, subclass, sbuf_data(&sb)); - if (sbuf_overflowed(&sb)) + if (error != 0) printf("ZFS WARNING: sbuf overflowed\n"); sbuf_delete(&sb); #endif @@ -331,6 +332,7 @@ zfs_post_common(spa_t *spa, vdev_t *vd, const char *name) char class[64]; struct sbuf sb; struct timespec ts; + int error; nanotime(&ts); @@ -346,10 +348,10 @@ zfs_post_common(spa_t *spa, vdev_t *vd, const char *name) if (vd) sbuf_printf(&sb, " %s=%ju", FM_EREPORT_PAYLOAD_ZFS_VDEV_GUID, vd->vdev_guid); - sbuf_finish(&sb); + error = sbuf_finish(&sb); ZFS_LOG(1, "%s", sbuf_data(&sb)); devctl_notify("ZFS", spa->spa_name, class, sbuf_data(&sb)); - if (sbuf_overflowed(&sb)) + if (error != 0) printf("ZFS WARNING: sbuf overflowed\n"); sbuf_delete(&sb); #endif |