git: hammer2 - Fix CHECK fail path that might mangle an inode in-memory

Matthew Dillon dillon at crater.dragonflybsd.org
Thu Apr 21 22:45:09 PDT 2022


commit f3bfcc3fda3d70dd80cbb0440b5b8649ca2d07de
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date:   Thu Apr 21 22:37:21 2022 -0700

    hammer2 - Fix CHECK fail path that might mangle an inode in-memory
    
    * Allowing the wrong inode block to be entered in-memory can result in
      massive filesystem confusion.
    
    * Add a sanity check in hammer2_chain_inode_find() to validate that
      the inode field in an on-media inode matches the inode number we are
      trying to look up.  This case is not supposed to happen, but it did on
      grok's /build5 partition (likely due to a bulkfree early-termination
      issue which is now being looked at).
    
      If this test fails, we simulate a CRC CHECK failure.
    
    * Remove hammer2_cluster_resolve() (it was replaced by hammer2_cluster_check()).

Summary of changes:
 sys/vfs/hammer2/hammer2.h         |   1 -
 sys/vfs/hammer2/hammer2_admin.c   |   4 +-
 sys/vfs/hammer2/hammer2_chain.c   |  39 +++-
 sys/vfs/hammer2/hammer2_cluster.c | 388 +-------------------------------------
 sys/vfs/hammer2/hammer2_xops.c    |   6 +
 5 files changed, 50 insertions(+), 388 deletions(-)

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


-- 
DragonFly BSD source repository



More information about the Commits mailing list