diff --git a/module/zstd/zfs_zstd.c b/module/zstd/zfs_zstd.c index ed0271a8d6..05120d27b8 100644 --- a/module/zstd/zfs_zstd.c +++ b/module/zstd/zfs_zstd.c @@ -844,6 +844,13 @@ zstd_mempool_deinit(void) void zfs_zstd_cache_reap_now(void) { + + /* + * Short-circuit if there are no buffers to begin with. + */ + if (ZSTDSTAT(zstd_stat_buffers) == 0) + return; + /* * calling alloc with zero size seeks * and releases old unused objects