Skip to content

Commit e53e60c

Browse files
authored
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
1 parent 2ebb9a4 commit e53e60c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

module/zfs/dmu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1501,9 +1501,9 @@ dmu_assign_arcbuf_by_dnode(dnode_t *dn, uint64_t offset, arc_buf_t *buf,
15011501
rw_enter(&dn->dn_struct_rwlock, RW_READER);
15021502
blkid = dbuf_whichblock(dn, 0, offset);
15031503
db = dbuf_hold(dn, blkid, FTAG);
1504+
rw_exit(&dn->dn_struct_rwlock);
15041505
if (db == NULL)
15051506
return (SET_ERROR(EIO));
1506-
rw_exit(&dn->dn_struct_rwlock);
15071507

15081508
/*
15091509
* We can only assign if the offset is aligned and the arc buf is the

0 commit comments

Comments
 (0)