aboutsummaryrefslogtreecommitdiffstats
path: root/lib/libzfs_core
diff options
context:
space:
mode:
authorRyan Moeller <[email protected]>2020-08-18 21:07:43 -0400
committerGitHub <[email protected]>2020-08-18 18:07:43 -0700
commit4f7fb135bda604256641454f390a03d7b805edba (patch)
treebbaed41a56b466964e9f548959487cff4e43c037 /lib/libzfs_core
parent716b53d0a14c72bda16c0872565dd1909757e73f (diff)
libzfs_core: Initialize fail_ioc_cmd to ZFS_IOC_LAST
FreeBSD numbers `ZFS_IOC_*` starting at 0, so pick a different sentinel value to avoid unintentionally messing with `ZFS_IOC_POOL_CREATE` ioctls. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #10729
Diffstat (limited to 'lib/libzfs_core')
-rw-r--r--lib/libzfs_core/libzfs_core.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libzfs_core/libzfs_core.c b/lib/libzfs_core/libzfs_core.c
index d35ea523e..50b1b9dec 100644
--- a/lib/libzfs_core/libzfs_core.c
+++ b/lib/libzfs_core/libzfs_core.c
@@ -97,7 +97,7 @@ static pthread_mutex_t g_lock = PTHREAD_MUTEX_INITIALIZER;
static int g_refcount;
#ifdef ZFS_DEBUG
-static zfs_ioc_t fail_ioc_cmd;
+static zfs_ioc_t fail_ioc_cmd = ZFS_IOC_LAST;
static zfs_errno_t fail_ioc_err;
static void
@@ -118,7 +118,7 @@ libzfs_core_debug_ioc(void)
* cannot checkpoint 'tank': the loaded zfs module does not support
* this operation. A reboot may be required to enable this operation.
*/
- if (fail_ioc_cmd == 0) {
+ if (fail_ioc_cmd == ZFS_IOC_LAST) {
char *ioc_test = getenv("ZFS_IOC_TEST");
unsigned int ioc_num = 0, ioc_err = 0;