git: DragonFly_RELEASE_6_2 hammer2 - Fix bulkfree bug when multiple PFSs are mounted

Matthew Dillon dillon at crater.dragonflybsd.org
Wed Apr 27 09:19:19 PDT 2022


commit b9d7e8a4f508d3ec1f95f09d8bec3c68a8f5cb8b
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date:   Mon Apr 25 19:21:38 2022 -0700

    hammer2 - Fix bulkfree bug when multiple PFSs are mounted
    
    * If multiple PFSs from the same block device are mounted, the bulkfree
      directive can sometimes free blocks that are actually not free.
    
      This situation can only occur:
    
      (1) When 2 or more PFS's are mounted from the same block device.
      (2) When heavy file ops occur near the start of a bulkfree.
    
    * The problem was due to the bulkfree code only flushing the
      passed-in PFS before starting the scan on the device (which might
      house multiple PFSs).  This can cause both scan stages to occur
      without a full synchronization of all modified PFSs on the device
      inbetween them.
    
    * Fixes by ensuring that all PFSs associated with the block device
      are flushed with the blockfree lock held in order to get the guarantee
      back.

Summary of changes:
 sys/vfs/hammer2/hammer2_ioctl.c  | 48 +++++++++++++++++++------------
 sys/vfs/hammer2/hammer2_vfsops.c | 62 ++--------------------------------------
 2 files changed, 31 insertions(+), 79 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/b9d7e8a4f508d3ec1f95f09d8bec3c68a8f5cb8b


-- 
DragonFly BSD source repository


More information about the Commits mailing list