Skip to content

Commit

Permalink
DLPX-63631 send_realloc_files fails intermittently (openzfs#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
pcd1193182 authored Apr 17, 2019
1 parent 63cbc1c commit d7a6342
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions module/zfs/dmu_send.c
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,9 @@ static void
range_free(struct send_range *range)
{
if (range->type == OBJECT) {
kmem_free(range->sru.object.dnp,
sizeof (*range->sru.object.dnp));
size_t size = sizeof (dnode_phys_t) *
(range->sru.object.dnp->dn_extra_slots + 1);
kmem_free(range->sru.object.dnp, size);
}
kmem_free(range, sizeof (*range));
}
Expand Down Expand Up @@ -1119,8 +1120,9 @@ send_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp,
return (0);
record = range_alloc(OBJECT, zb->zb_object, 0, 0, B_FALSE);
record->sru.object.bp = *bp;
record->sru.object.dnp = kmem_alloc(sizeof (*dnp), KM_SLEEP);
*record->sru.object.dnp = *dnp;
size_t size = sizeof (*dnp) * (dnp->dn_extra_slots + 1);
record->sru.object.dnp = kmem_alloc(size, KM_SLEEP);
bcopy(dnp, record->sru.object.dnp, size);
bqueue_enqueue(&sta->q, record, sizeof (*record));
return (0);
}
Expand Down

0 comments on commit d7a6342

Please sign in to comment.