]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Fix the L2ARC write size calculating logic (2)
authorGeorge Amanakis <gamanakis@gmail.com>
Sat, 10 Jun 2023 00:05:47 +0000 (02:05 +0200)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Mon, 26 Jun 2023 20:59:36 +0000 (13:59 -0700)
commitc12b5829e1e2e4ff96683e55a123dd01205f1574
treee8d2bef5f1a40f3565a28d8d6c3d22ee2dd050e3
parent425f7895dd9a2cdd17e3f7ef1f38ea8de2b174e6
Fix the L2ARC write size calculating logic (2)

While commit bcd5321 adjusts the write size based on the size of the log
block, this happens after comparing the unadjusted write size to the
evicted (target) size.

In this case l2ad_hand will exceed l2ad_evict and violate an assertion
at the end of l2arc_write_buffers().

Fix this by adding the max log block size to the allocated size of the
buffer to be committed before comparing the result to the target
size.

Also reset the l2arc_trim_ahead ZFS module variable when the adjusted
write size exceeds the size of the L2ARC device.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: George Amanakis <gamanakis@gmail.com>
Closes #14936
Closes #14954
module/zfs/arc.c