]> git.proxmox.com Git - mirror_zfs.git/commit
Fix race in dnode_check_slots_free()
authorTom Caputi <tcaputi@datto.com>
Tue, 10 Apr 2018 18:15:05 +0000 (14:15 -0400)
committerTony Hutter <hutter2@llnl.gov>
Thu, 8 Nov 2018 22:38:28 +0000 (14:38 -0800)
commitb32f1279d4a09a932dcbfa79e125ce60cd8d75bf
tree76cfe719dca9847a88d8226631c3565d7b939456
parent1b0cd071317f991891c91b06f1cb51cf9350a20d
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
include/sys/dmu_impl.h
include/sys/dnode.h
module/zfs/dbuf.c
module/zfs/dmu.c
module/zfs/dmu_objset.c
module/zfs/dnode.c