]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit - contrib/llvm/lib/Target/ARC/ARCMachineFunctionInfo.cpp
MFV r353558: 10572 10579 Fix race in dnode_check_slots_free()
authorAndriy Gapon <avg@FreeBSD.org>
Tue, 15 Oct 2019 14:29:18 +0000 (14:29 +0000)
committerAndriy Gapon <avg@FreeBSD.org>
Tue, 15 Oct 2019 14:29:18 +0000 (14:29 +0000)
commit563db1a9475896a9f6f14ca0eb4d4c47bfedd487
treef14a033706eb95cd5f2688e9b888dafd33950f17
parent436858933814e5b174aed0748591c93bab12792c
parenta4a9c977b9efb8f606c662e31d221af7b15c2a2d
MFV r353558: 10572 10579 Fix race in dnode_check_slots_free()

illumos/illumos-gate@aa02ea01948372a32cbf08bfc31c72c32e3fc81e
https://github.com/illumos/illumos-gate/commit/aa02ea01948372a32cbf08bfc31c72c32e3fc81e

10572 Fix race in dnode_check_slots_free()
https://www.illumos.org/issues/10572
  The Fix from ZoL:
  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.

10579 Don't allow dnode allocation if dn_holds != 0
https://www.illumos.org/issues/10579
  The fix from ZoL:
  This patch simply fixes a small bug where dnode_hold_impl() could
  attempt to allocate a dnode that was in the process of being freed,
  but which still had active references. This patch simply adds the
  required check.

Author: Tom Caputi <tcaputi@datto.com>
Reported by: delphij
MFC after: 2 weeks
X-MFC with: r353176
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_impl.h
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h