From 7d9cfc58b81f6b4e684e0267ddb7379abccf7f38 Mon Sep 17 00:00:00 2001 From: Alan Somers Date: Thu, 14 Jul 2022 09:34:55 -0600 Subject: [PATCH] Fix intermittent EINVAL in ZFSPool.sync Sometimes ZFSPool.sync doesn't pass the pool_name argument to lzc_sync correctly. lzc_sync sees an empty string. Replacing the self.name property access with the self.handle instance variable access seems to fix the problem, though I don't understand why. Fixes #193 --- libzfs.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libzfs.pyx b/libzfs.pyx index 70e84a8..3cd7541 100644 --- a/libzfs.pyx +++ b/libzfs.pyx @@ -2892,7 +2892,7 @@ cdef class ZFSPool(object): IF HAVE_LZC_SYNC: def sync(self, force=False): cdef int ret - cdef const char *c_name = self.name + cdef const char *c_name = libzfs.zpool_get_name(self.handle) cdef NVList innvl = NVList() innvl["force"] = force