aboutsummaryrefslogtreecommitdiff
path: root/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fm.c
diff options
context:
space:
mode:
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.c10
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 63ae13ac856a..cf2f90db69d0 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