From 16b94db49d6d57e905f39c06d9a40014df692a4f Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Fri, 28 Oct 2022 13:25:37 -0700 Subject: [PATCH] Revert "Cleanup: Delete dead code from send_merge_thread()" This reverts commit fb823de9f due to a regression. It is in fact possible for the range->eos_marker to be false on error. Reviewed-by: Richard Yao Signed-off-by: Brian Behlendorf Issue #14042 Closes #14104 --- module/zfs/dmu_send.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/module/zfs/dmu_send.c b/module/zfs/dmu_send.c index 8c96a862762f..ccb7eb20756d 100644 --- a/module/zfs/dmu_send.c +++ b/module/zfs/dmu_send.c @@ -1586,8 +1586,9 @@ send_merge_thread(void *arg) } range_free(front_ranges[i]); } - ASSERT3P(range, !=, NULL); - ASSERT3S(range->eos_marker, ==, B_TRUE); + if (range == NULL) + range = kmem_zalloc(sizeof (*range), KM_SLEEP); + range->eos_marker = B_TRUE; bqueue_enqueue_flush(&smt_arg->q, range, 1); spl_fstrans_unmark(cookie); thread_exit();