mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-25 11:47:43 +03:00
Fix error handling incallers of dbuf_hold_level()
Currently, the functions dbuf_prefetch_indirect_done() and dmu_assign_arcbuf_by_dnode() assume that dbuf_hold_level() cannot fail. In the event of an error the former will cause a NULL pointer dereference and the later will trigger a VERIFY. This patch adds error handling to these functions and their callers where necessary. Reviewed by: Matt Ahrens <mahrens@delphix.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Tom Caputi <tcaputi@datto.com> Closes #8291
This commit is contained in:
committed by
Brian Behlendorf
parent
75058f3303
commit
305781da4b
@@ -844,8 +844,13 @@ zfs_write(struct inode *ip, uio_t *uio, int ioflag, cred_t *cr)
|
||||
xuio_stat_wbuf_copied();
|
||||
} else {
|
||||
ASSERT(xuio || tx_bytes == max_blksz);
|
||||
dmu_assign_arcbuf_by_dbuf(
|
||||
error = dmu_assign_arcbuf_by_dbuf(
|
||||
sa_get_db(zp->z_sa_hdl), woff, abuf, tx);
|
||||
if (error != 0) {
|
||||
dmu_return_arcbuf(abuf);
|
||||
dmu_tx_commit(tx);
|
||||
break;
|
||||
}
|
||||
}
|
||||
ASSERT(tx_bytes <= uio->uio_resid);
|
||||
uioskip(uio, tx_bytes);
|
||||
|
||||
Reference in New Issue
Block a user