git: hammer2 - Add truncation lock, change dio persistence

Matthew Dillon dillon at
Fri Jun 10 11:12:28 PDT 2016

commit 63be6fedbdb22faa0427ad4d674c904d5f5bdf89
Author: Matthew Dillon <dillon at>
Date:   Fri Jun 10 11:09:29 2016 -0700

    hammer2 - Add truncation lock, change dio persistence
    * Add a truncation lock to interlock between write()'s and ftruncate()
      calls.  This prevents a junk buffer from surviving a ftruncate() if
      it happens to get written concurrently with the ftruncate().
    * Change dio persistence.  Do not automatically persist dio's while refs
      are held, this creates problems for ref'd chains held in the
      hammer2_inode_t structure and prevents vfsync() from working properly.
      Add a persist_refs field which we will use later in the XIO code to
      persist a chain's DIO across an unlock/relock sequence, and possibly
      in other places too.

Summary of changes:
 sys/vfs/hammer2/hammer2.h       |  3 +-
 sys/vfs/hammer2/hammer2_chain.c | 84 ++++++++---------------------------------
 sys/vfs/hammer2/hammer2_vnops.c |  9 +++++
 3 files changed, 27 insertions(+), 69 deletions(-)

DragonFly BSD source repository

More information about the Commits mailing list