From 50f9ea01499be508918e33923e004bf5dcf390e3 Mon Sep 17 00:00:00 2001 From: Will Andrews Date: Sun, 26 Apr 2015 15:30:46 -0700 Subject: [PATCH] Illumos 5814 - bpobj_iterate_impl(): Close a refcount leak iterating on a sublist. 5814 bpobj_iterate_impl(): Close a refcount leak iterating on a sublist. Reviewed by: Prakash Surya Reviewed by: Matthew Ahrens Reviewed by: Paul Dagnelie Reviewed by: Simon Klinkert Approved by: Gordon Ross References: https://www.illumos.org/issues/5814 https://github.com/illumos/illumos-gate/commit/b67dde11 Ported-by: DHE Signed-off-by: Brian Behlendorf Closes #3368 --- module/zfs/bpobj.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/module/zfs/bpobj.c b/module/zfs/bpobj.c index 7c8f932f5..25767e83f 100644 --- a/module/zfs/bpobj.c +++ b/module/zfs/bpobj.c @@ -301,8 +301,10 @@ bpobj_iterate_impl(bpobj_t *bpo, bpobj_itor_t func, void *arg, dmu_tx_t *tx, if (free) { err = bpobj_space(&sublist, &used_before, &comp_before, &uncomp_before); - if (err) + if (err != 0) { + bpobj_close(&sublist); break; + } } err = bpobj_iterate_impl(&sublist, func, arg, tx, free); if (free) { -- 2.40.0