Fix l2arc_apply_transforms ztest crash
commitcc75c816c539d22c56aa912d5db19827a16dcbf3
authorPaul Dagnelie <pcd@delphix.com>
Tue, 19 Sep 2023 15:58:14 +0000 (19 08:58 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 22 Sep 2023 23:13:20 +0000 (22 16:13 -0700)
tree2242e990e6c13719ef6e7f57e319bb55714e33b7
parent1c2aee7a5222b1b65fea07dd7ee18ae14c3f7be2
Fix l2arc_apply_transforms ztest crash

In #13375 we modified the allocation size of the buffer that we use
to apply l2arc transforms to be the size of the arc hdr we're using,
rather than the allocation size that will be in place on the disk,
because sometimes the hdr size is larger. Unfortunately, sometimes
the allocation size is larger, which means that we overflow the buffer
in that case. This change modifies the allocation to be the max of
the two values

Reviewed-by: Mark Maybee <mark.maybee@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Paul Dagnelie <pcd@delphix.com>
Closes #15177
Closes #15248
module/zfs/arc.c