From e4d3d776844fd9c53b4bb641e21a7eff62052dca Mon Sep 17 00:00:00 2001 From: Brian Atkinson Date: Tue, 14 Jul 2020 12:04:35 -0600 Subject: Fixing gang ABD child removal race condition On linux the list debug code has been setting off a failure when checking that the node->next->prev value is pointing back at the node. At times this check evaluates to 0xdead. When removing a child from a gang ABD we must acquire the child's abd_mtx to make sure that the same ABD is not being added to another gang ABD while it is being removed from a gang ABD. This fixes a race condition when checking if an ABDs link is already active and part of another gang ABD before adding it to a gang. Added additional debug code for the gang ABD in abd_verify() to make sure each child ABD has active links. Also check to make sure another gang ABD is not added to a gang ABD. Reviewed-by: Serapheim Dimitropoulos Reviewed-by: Brian Behlendorf Reviewed-by: Matt Ahrens Signed-off-by: Brian Atkinson Closes #10511 --- lib/libspl/list.c | 1 + 1 file changed, 1 insertion(+) (limited to 'lib') diff --git a/lib/libspl/list.c b/lib/libspl/list.c index 52327b2bb..0f2f3731b 100644 --- a/lib/libspl/list.c +++ b/lib/libspl/list.c @@ -232,6 +232,7 @@ list_link_init(list_node_t *ln) int list_link_active(list_node_t *ln) { + EQUIV(ln->next == NULL, ln->prev == NULL); return (ln->next != NULL); } -- cgit v1.2.3