diff options
author | chrisrd <[email protected]> | 2019-10-24 09:26:17 +1100 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2019-10-23 15:26:17 -0700 |
commit | 05d07ba9a7f104e71c4052abe0be1cb96ba012d1 (patch) | |
tree | 0fcf2930b98ef269cba7020be6543b81bc1e7f16 | |
parent | 64b2e7d7ecd97fe181e9b909a52196c4b0474747 (diff) |
Don't call arc_buf_destroy on unallocated arc_buf
Fixes an obvious issue of calling arc_buf_destroy() on an
unallocated arc_buf.
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Matt Ahrens <[email protected]>
Reviewed-by: Paul Dagnelie <[email protected]>
Signed-off-by: Chris Dunlop <[email protected]>
Closes #9453
-rw-r--r-- | module/zfs/dmu_send.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/module/zfs/dmu_send.c b/module/zfs/dmu_send.c index ea28dbc28..b0a56650e 100644 --- a/module/zfs/dmu_send.c +++ b/module/zfs/dmu_send.c @@ -924,6 +924,7 @@ do_dump(dmu_send_cookie_t *dscp, struct send_range *range) blkptr_t *bp = &srdp->bp; spa_t *spa = dmu_objset_spa(dscp->dsc_os); + arc_buf_t *abuf = NULL; ASSERT3U(srdp->datablksz, ==, BP_GET_LSIZE(bp)); ASSERT3U(range->start_blkid + 1, ==, range->end_blkid); @@ -936,7 +937,6 @@ do_dump(dmu_send_cookie_t *dscp, struct send_range *range) zioflags |= ZIO_FLAG_RAW; } - arc_buf_t *abuf; zbookmark_phys_t zb; ASSERT3U(range->start_blkid, ==, DMU_SPILL_BLKID); zb.zb_objset = dmu_objset_id(dscp->dsc_os); @@ -949,8 +949,10 @@ do_dump(dmu_send_cookie_t *dscp, struct send_range *range) zioflags, &aflags, &zb) != 0) return (SET_ERROR(EIO)); - err = dump_spill(dscp, bp, zb.zb_object, abuf->b_data); - arc_buf_destroy(abuf, &abuf); + err = dump_spill(dscp, bp, zb.zb_object, + (abuf == NULL ? NULL : abuf->b_data)); + if (abuf != NULL) + arc_buf_destroy(abuf, &abuf); return (err); } if (send_do_embed(dscp, bp)) { @@ -965,7 +967,6 @@ do_dump(dmu_send_cookie_t *dscp, struct send_range *range) dscp->dsc_resume_offset)); /* it's a level-0 block of a regular object */ arc_flags_t aflags = ARC_FLAG_WAIT; - arc_buf_t *abuf = NULL; uint64_t offset; /* |