From 2334bc4efa9aeb6052d8c8c839efbdf784ac4e91 Mon Sep 17 00:00:00 2001 From: Jorgen Lundman Date: Fri, 2 Jul 2021 00:22:16 +0900 Subject: [PATCH] Upstream: dmu_zfetch_stream_fini leaks refcount dmu_zfetch_stream_fini() is missing calls to destroy the refcounts, leaking them and the mutex inside. Reviewed-by: Matthew Ahrens Reviewed-by: Brian Behlendorf Reviewed-by: Alexander Motin Signed-off-by: Jorgen Lundman Closes #12294 --- module/zfs/dmu_zfetch.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/module/zfs/dmu_zfetch.c b/module/zfs/dmu_zfetch.c index 4a323fa990..a26b0d7399 100644 --- a/module/zfs/dmu_zfetch.c +++ b/module/zfs/dmu_zfetch.c @@ -159,6 +159,8 @@ static void dmu_zfetch_stream_fini(zstream_t *zs) { ASSERT(!list_link_active(&zs->zs_node)); + zfs_refcount_destroy(&zs->zs_callers); + zfs_refcount_destroy(&zs->zs_refs); kmem_free(zs, sizeof (*zs)); }