From 1e385a8ebd12c8091cb80663adef981a15d3e129 Mon Sep 17 00:00:00 2001 From: Tim Chase Date: Mon, 27 Feb 2017 23:56:07 -0600 Subject: [PATCH] Format an error message when the ZFS_IOC_POOL_TRIM fails The message should be written to "msg" before calling zpool_standard_error(). --- lib/libzfs/libzfs_pool.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/libzfs/libzfs_pool.c b/lib/libzfs/libzfs_pool.c index aae61508f45b..5a307c844b61 100644 --- a/lib/libzfs/libzfs_pool.c +++ b/lib/libzfs/libzfs_pool.c @@ -1964,6 +1964,8 @@ zpool_trim(zpool_handle_t *zhp, boolean_t start, uint64_t rate) if (zfs_ioctl(hdl, ZFS_IOC_POOL_TRIM, &zc) == 0) return (0); + (void) snprintf(msg, sizeof (msg), + dgettext(TEXT_DOMAIN, "cannot trim %s"), zc.zc_name); return (zpool_standard_error(hdl, errno, msg)); }