git: DragonFly_RELEASE_6_2 hammer2 - Fix issue where deleted files sometimes linger until umount

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


commit 3a3f840853f9b25de8d02d70f95d37113eb14655
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date:   Mon Apr 25 20:04:01 2022 -0700

    hammer2 - Fix issue where deleted files sometimes linger until umount
    
    * Hammer2 was using a namecache heuristic to determine if a file being
      deleted was still open or not, but had not coded any sort of fall-back
      if the heuristic failed.
    
      This created an issue where the inodes for deleted files would sometimes
      linger until the filesystem is unmounted (typically at system shutdown).
      If the system were to crash, these inodes would remain in the media
      topology forever.
    
      This case primarily occurs when a large number of files are being
      deleted.
    
    * Replace the heuristic with a proper interlock so H2 knows with certainty
      whether a file being removed still has system refs on it or not.

Summary of changes:
 sys/vfs/hammer2/hammer2.h       |  2 +-
 sys/vfs/hammer2/hammer2_inode.c | 65 +++++++++++++++++++++++++++--------------
 sys/vfs/hammer2/hammer2_vnops.c | 61 ++++++++++++++++----------------------
 3 files changed, 69 insertions(+), 59 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/3a3f840853f9b25de8d02d70f95d37113eb14655


-- 
DragonFly BSD source repository


More information about the Commits mailing list