git: hammer2 - Present hardlink solution, misc stability work

Matthew Dillon dillon at
Tue Nov 17 17:33:16 PST 2015

commit 2efe493b366f9b5f683af645f94e85f257fec556
Author: Matthew Dillon <dillon at>
Date:   Tue Nov 17 17:21:14 2015 -0800

    hammer2 - Present hardlink solution, misc stability work
    * The H2 design has had a long-standing problem of losing track of
      hardlinks when intermediate directories are renamed, breaking the
      common-parent-directory design for the inode target.
      Fix this issue by placing the hardlink target in the first common
      parent directory chflagged 'xlink' (or the root of the mount if
      no parent is chflagged 'xlink').  Thus, by default, hardlink targets
      for cross-directory situations will be placed in the root of the mount
      and thus no confusion can ever occur if a mid-path directory is moved
      within the hierarchy.
    * This change does not modify the behavior of placing the hardlink target
      in the same directory as the hardlink pointers when they are all in the
      same directory.
    * installworld now chflags /*, /usr/*, /var/*, and /home/* 'xlink'.
    * Note that hardlink and rename operations across 'xlink' boundaries
      are disallowed (for obvious reasons), but system operators have very
      rarely used hardlinks in major directory crossings.  However, we might
      be pushing it a bit much to automatically chflag /home/*.
      In the past there have been a few minor situations where major-crossing
      hardlinks are attempted.  'lpr' for example tries to hardlink a user
      file into /var/spool, but will copy it if it cannot.  Similarly there
      have been situations in the past where hardlinks between home directories
      have been used to save space, but franklyl softlinks can be used almost
      as easily and such situations have fallen into disfavor.
    * Stability improvements to the XOP FIFO mechanics, locking cleanups.

Summary of changes:
 sys/sys/mutex2.h                 | 12 ++++++++
 sys/vfs/hammer2/hammer2.h        | 19 ++++---------
 sys/vfs/hammer2/hammer2_chain.c  | 60 ++++++++++++++++++++++++++--------------
 sys/vfs/hammer2/hammer2_inode.c  | 54 +++++++++++++++++++++++++++---------
 sys/vfs/hammer2/hammer2_thread.c | 31 +++++++++++++++++++--
 sys/vfs/hammer2/hammer2_vnops.c  | 33 ++++++++++++++++------
 sys/vfs/hammer2/hammer2_xops.c   |  7 ++---
 7 files changed, 153 insertions(+), 63 deletions(-)

DragonFly BSD source repository

More information about the Commits mailing list