]> granicus.if.org Git - zfs/commitdiff
Illumos 5814 - bpobj_iterate_impl(): Close a refcount leak iterating on a sublist.
authorWill Andrews <will@freebsd.org>
Sun, 26 Apr 2015 22:30:46 +0000 (15:30 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Mon, 4 May 2015 17:28:18 +0000 (10:28 -0700)
5814 bpobj_iterate_impl(): Close a refcount leak iterating on a sublist.
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Paul Dagnelie <paul.dagnelie@delphix.com>
Reviewed by: Simon Klinkert <simon.klinkert@gmail.com>
Approved by: Gordon Ross <gwr@nexenta.com>

References:
  https://www.illumos.org/issues/5814
  https://github.com/illumos/illumos-gate/commit/b67dde11

Ported-by: DHE <git@dehacked.net>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #3368

module/zfs/bpobj.c

index 7c8f932f5cf316941bb27935db9de04274b62951..25767e83fed092ed36d578491699a755e3e7169a 100644 (file)
@@ -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) {