]> git.proxmox.com Git - mirror_zfs.git/commitdiff
Upstream: dmu_zfetch_stream_fini leaks refcount
authorJorgen Lundman <lundman@lundman.net>
Thu, 1 Jul 2021 15:22:16 +0000 (00:22 +0900)
committerGitHub <noreply@github.com>
Thu, 1 Jul 2021 15:22:16 +0000 (09:22 -0600)
dmu_zfetch_stream_fini() is missing calls to destroy the refcounts,
leaking them and the mutex inside.

Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Jorgen Lundman <lundman@lundman.net>
Closes #12294

module/zfs/dmu_zfetch.c

index 4a323fa990feb09e44db6feb85ba72b60a05aa87..a26b0d73992163e9dce7544ba88f0d2a9d1327e5 100644 (file)
@@ -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));
 }