HomeFreeBSD

arc: avoid possible deadlock in arc_read

Description

arc: avoid possible deadlock in arc_read

In l2arc_evict(), the config lock may be acquired in reverse order
(e.g., first the config lock (writer), then a hash lock) unlike in
arc_read() during scenarios like L2ARC device removal. To avoid
deadlocks, if the attempt to acquire the config lock (reader) fails
in arc_read(), release the hash lock, wait for the config lock, and
retry from the beginning.

Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Ameer Hamza <ahamza@ixsystems.com>
Closes #17071

Details

Provenance
Ameer Hamza <ahamza@ixsystems.com>Authored on Tue, Feb 25, 7:32 PM
GitHub <noreply@github.com>Committed on Tue, Feb 25, 7:32 PM
Parents
rG701093c44fdf: Don't try to get mg of hole vdev in removal
Branches
Unknown
Tags
Unknown