aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGvozden Neskovic <[email protected]>2017-08-30 21:09:18 +0200
committerBrian Behlendorf <[email protected]>2017-08-30 12:09:18 -0700
commitd22323e89f13975e1a60860aa78609584f00a606 (patch)
treeb28b46f5c0b25d25daee81eaee94a263975a65af
parent74ea6092d0693b6e1c6daaee0fdc79491697996c (diff)
dmu_objset: release bonus buffer in failure path
Reported by kmemleak during testing of a new patch: ``` unreferenced object 0xffff9f1c12e38800 (size 1024): comm "z_upgrade", pid 17842, jiffies 4296870904 (age 8746.268s) backtrace: kmemleak_alloc+0x7a/0x100 __kmalloc_node+0x26c/0x510 range_tree_create+0x39/0xa0 [zfs] dmu_zfetch_init+0x73/0xe0 [zfs] dnode_create+0x12c/0x3b0 [zfs] dnode_hold_impl+0x1096/0x1130 [zfs] dnode_hold+0x23/0x30 [zfs] dmu_bonus_hold_impl+0x6b/0x370 [zfs] dmu_bonus_hold+0x1e/0x30 [zfs] dmu_objset_space_upgrade+0x114/0x310 [zfs] dmu_objset_userobjspace_upgrade_cb+0xd8/0x150 [zfs] dmu_objset_upgrade_task_cb+0x136/0x1e0 [zfs] kthread+0x119/0x150 ``` Reviewed-by: George Melikov <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Giuseppe Di Natale <[email protected]> Signed-off-by: Gvozden Neskovic <[email protected]> Closes #6575
-rw-r--r--module/zfs/dmu_objset.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/module/zfs/dmu_objset.c b/module/zfs/dmu_objset.c
index 3faa299d1..4445121a0 100644
--- a/module/zfs/dmu_objset.c
+++ b/module/zfs/dmu_objset.c
@@ -2032,6 +2032,7 @@ dmu_objset_space_upgrade(objset_t *os)
dmu_tx_hold_bonus(tx, obj);
objerr = dmu_tx_assign(tx, TXG_WAIT);
if (objerr != 0) {
+ dmu_buf_rele(db, FTAG);
dmu_tx_abort(tx);
continue;
}