HomeFreeBSD

Fix race in dnode_check_slots_free()

Description

Fix race in dnode_check_slots_free()

Currently, dnode_check_slots_free() works by checking dn->dn_type
in the dnode to determine if the dnode is reclaimable. However,
there is a small window of time between dnode_free_sync() in the
first call to dsl_dataset_sync() and when the useraccounting code
is run when the type is set DMU_OT_NONE, but the dnode is not yet
evictable, leading to crashes. This patch adds the ability for
dnodes to track which txg they were last dirtied in and adds a
check for this before performing the reclaim.

This patch also corrects several instances when dn_dirty_link was
treated as a list_node_t when it is technically a multilist_node_t.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tom Caputi <tcaputi@datto.com>
Closes #7147
Closes #7388

Details

Provenance
Tom Caputi <tcaputi@datto.com>Authored on Apr 10 2018, 6:15 PM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Apr 10 2018, 6:15 PM
Parents
rG10f88c5cd523: Linux compat 4.16: blk_queue_flag_{set,clear}
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rGedc1e713c294: Fix race in dnode_check_slots_free() (authored by Tom Caputi <tcaputi@datto.com>).Apr 10 2018, 6:15 PM