aboutsummaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorAlexander Motin <[email protected]>2023-12-08 19:43:39 -0500
committerBrian Behlendorf <[email protected]>2024-01-08 16:11:39 -0800
commitb13c91bb2997cb121cdf935496f92ae773672773 (patch)
tree9fd205186886472b3867edb70cf9df7ab2eb12d6 /module
parente09356fa05ff174ed02ade8ea8e4ab98effa0ccd (diff)
DMU: Fix lock leak on dbuf_hold() error
dmu_assign_arcbuf_by_dnode() should drop dn_struct_rwlock lock in case dbuf_hold() failed. I don't have reproduction for this, but it looks inconsistent with dmu_buf_hold_noread_by_dnode() and co. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Alexander Motin <[email protected]> Sponsored by: iXsystems, Inc. Closes #15644
Diffstat (limited to 'module')
-rw-r--r--module/zfs/dmu.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/module/zfs/dmu.c b/module/zfs/dmu.c
index 63464d747..909605aa2 100644
--- a/module/zfs/dmu.c
+++ b/module/zfs/dmu.c
@@ -1482,9 +1482,9 @@ dmu_assign_arcbuf_by_dnode(dnode_t *dn, uint64_t offset, arc_buf_t *buf,
rw_enter(&dn->dn_struct_rwlock, RW_READER);
blkid = dbuf_whichblock(dn, 0, offset);
db = dbuf_hold(dn, blkid, FTAG);
+ rw_exit(&dn->dn_struct_rwlock);
if (db == NULL)
return (SET_ERROR(EIO));
- rw_exit(&dn->dn_struct_rwlock);
/*
* We can only assign if the offset is aligned and the arc buf is the