diff options
author | Tom Caputi <[email protected]> | 2019-01-17 18:47:08 -0500 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2019-01-17 15:47:08 -0800 |
commit | 305781da4bbe11acef8707894d7e33f8aef3ca8e (patch) | |
tree | 3ac436d2d8c1fe88daee63964e838bdab9f63cd2 /include/sys | |
parent | 75058f33034d23801818582996d3dc941c545910 (diff) |
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 <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Tom Caputi <[email protected]>
Closes #8291
Diffstat (limited to 'include/sys')
-rw-r--r-- | include/sys/dmu.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/sys/dmu.h b/include/sys/dmu.h index 542eff95f..63c51ecfb 100644 --- a/include/sys/dmu.h +++ b/include/sys/dmu.h @@ -855,9 +855,9 @@ int dmu_write_uio_dnode(dnode_t *dn, struct uio *uio, uint64_t size, #endif struct arc_buf *dmu_request_arcbuf(dmu_buf_t *handle, int size); void dmu_return_arcbuf(struct arc_buf *buf); -void dmu_assign_arcbuf_by_dnode(dnode_t *dn, uint64_t offset, +int dmu_assign_arcbuf_by_dnode(dnode_t *dn, uint64_t offset, struct arc_buf *buf, dmu_tx_t *tx); -void dmu_assign_arcbuf_by_dbuf(dmu_buf_t *handle, uint64_t offset, +int dmu_assign_arcbuf_by_dbuf(dmu_buf_t *handle, uint64_t offset, struct arc_buf *buf, dmu_tx_t *tx); #define dmu_assign_arcbuf dmu_assign_arcbuf_by_dbuf void dmu_copy_from_buf(objset_t *os, uint64_t object, uint64_t offset, |