DragonFlyBSD/src 19808acsys/vfs/hammer2 hammer2_admin.c hammer2_inode.c

hammer2 - Fix corruption on sync, fix excessive stall, optimize sideq

* Fix topology corruption which can occur due to the new
  hammer2_chain_indirect_maintenance() code.  This code can make
  modifications to the parent from inside the flush code itself.
  This can cause the flush code's RB_SCAN() recursion to miss
  mandatory chains during the flush, resulting in some of the
  topology missing from the synchronized flush.

  This bug could cause corruption due to a crash, but not due to
  a normal unmount, shutdown, or reboot, because that code always
  runs extra sync() calls which corrects the problem.

  Fix the bug by detecting that UPDATE was again set in the parent
  and run the RB_SCAN() again.

* Fix an excessive stall that can occur in the XOP code due to a
  sleep/wakeup race.  This race could cause a VOP operation to stall
  for 60 seconds (it then hit some failsafe code and continued running
  normally).

  Fix this issue by removing hamemr2_xop_head->check_counter and
  integrating its flagging functions into run_mask.  Increase run_mask
  to 64 bits to accomodate the counter in the upper 32 bits.

* Optimize hammer2_inode_run_sideq().  Avoid running the sideq if the
  number of detached inodes is not significant, except when flushing
  in which case we always want to run the entire sideq.
DeltaFile
+55-32sys/vfs/hammer2/hammer2_admin.c
+29-1sys/vfs/hammer2/hammer2_inode.c
+13-12sys/vfs/hammer2/hammer2.h
+13-5sys/vfs/hammer2/hammer2_flush.c
+4-3sys/vfs/hammer2/hammer2_vnops.c
+1-1sys/vfs/hammer2/hammer2_chain.c
+1-1sys/vfs/hammer2/hammer2_vfsops.c
+116-557 files

UnifiedSplitRaw