HomeFreeBSD

Avoid panic in case of pool errors and missing L2ARC

Description

Avoid panic in case of pool errors and missing L2ARC

In case an ARC buffer is allocated only on L2ARC, and there are
underlying errors in a pool with the cache device in faulty state, a
panic can occur in arc_read_done()->arc_hdr_destroy()->
arc_hdr_l2arc_destroy()->arc_hdr_clear_flags() when trying to free
the ARC buffer.

Fix this by discarding the buffer's identity in arc_hdr_destroy(), in
case the buffer is not empty, before calling arc_hdr_l2hdr_destroy().

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: George Amanakis <gamanakis@gmail.com>
Closes #12392

Details

Provenance
g_amanakis_yahoo.comAuthored on Sep 16 2021, 4:40 PM
GitHub <noreply@github.com>Committed on Sep 16 2021, 4:40 PM
Parents
rG606574081189: Linux 5.14 compat: META
Branches
Unknown
Tags
Unknown