HomeFreeBSD

Fix ARC aggsum access after arc_state_fini()

Description

Fix ARC aggsum access after arc_state_fini()

Commit 85ec5cbae updated abd_update_scatter_stats() such that it
calls arc_space_consume() and arc_space_return() when updating the
scatter stats. This requires that the global aggsum value for the
ARC be initialized. Normally this is not an issue, however during
module unload the l2arc_do_free_on_write() function was called in
l2arc_cleanup() after arc_state_fini() destroyed the aggsum values.
We can resolve this issue by performing l2arc_do_free_on_write()
slightly earlier in arc_fini().

Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #10739

Details

Provenance
Brian Behlendorf <behlendorf1@llnl.gov>Authored on Aug 19 2020, 5:11 AM
GitHub <noreply@github.com>Committed on Aug 19 2020, 5:11 AM
Parents
rG4f7fb135bda6: libzfs_core: Initialize fail_ioc_cmd to ZFS_IOC_LAST
Branches
Unknown
Tags
Unknown

Event Timeline

GitHub <noreply@github.com> committed rGcfd59f904b07: Fix ARC aggsum access after arc_state_fini() (authored by Brian Behlendorf <behlendorf1@llnl.gov>).Aug 19 2020, 5:11 AM