Skip to content

Commit

Permalink
Illumos 5814 - bpobj_iterate_impl(): Close a refcount leak iterating …
Browse files Browse the repository at this point in the history
…on a sublist.

5814 bpobj_iterate_impl(): Close a refcount leak iterating on a sublist.
Reviewed by: Prakash Surya <[email protected]>
Reviewed by: Matthew Ahrens <[email protected]>
Reviewed by: Paul Dagnelie <[email protected]>
Reviewed by: Simon Klinkert <[email protected]>
Approved by: Gordon Ross <[email protected]>

References:
  https://www.illumos.org/issues/5814
  illumos/illumos-gate@b67dde11

Ported-by: DHE <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #3368
  • Loading branch information
wca authored and behlendorf committed May 4, 2015
1 parent 859735c commit 50f9ea0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion module/zfs/bpobj.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 50f9ea0

Please sign in to comment.