git: hammer2 - Fix critical bulkfree bug, refactor hammer2_io

Matthew Dillon dillon at
Tue Aug 29 15:03:54 PDT 2017

commit 85b1f267a5c33386e0761edb93a486fce13e8e88
Author: Matthew Dillon <dillon at>
Date:   Tue Aug 29 14:55:42 2017 -0700

    hammer2 - Fix critical bulkfree bug, refactor hammer2_io
    * The bulkfree scan code was corrupting storage elements allocated beyond
      the 512GB mark due to not resetting the bulk duplicate subtree detection
      heuristic for each new storage range being evaluated.
      Fixed by zeroing out the heuristic in the ranging loop.
    * Refactor hammer2_io.c.  This module was originally designed for completely
      asynchronous operation (with callbacks), but the backend chain code was
      subsequently redesigned to use kernel threads for each target device.  I/O
      operations in the kernel threads were issued synchronously.
      Remove all the asynchronous support code, which is like 50% of the module.
      Get rid of the IOCB mechanism entirely.  Simplify the hammer2_io structure
      and flags interactions and simplify the API.
    * Add some temporary debugging to the unmount path.

Summary of changes:
 sys/vfs/hammer2/hammer2.h          |  49 +--
 sys/vfs/hammer2/hammer2_bulkfree.c |  32 +-
 sys/vfs/hammer2/hammer2_flush.c    |   2 +
 sys/vfs/hammer2/hammer2_freemap.c  |   7 +-
 sys/vfs/hammer2/hammer2_io.c       | 841 +++++++++----------------------------
 sys/vfs/hammer2/hammer2_strategy.c |   2 +-
 sys/vfs/hammer2/hammer2_vfsops.c   |   5 +
 7 files changed, 241 insertions(+), 697 deletions(-)

DragonFly BSD source repository

More information about the Commits mailing list