commit 58898c0eb3f3dcaecea7216c70e96b4be4a3ff7f Author: Matthew Dillon <dil...@apollo.backplane.com> Date: Thu Apr 23 17:38:10 2020 -0700
hammer2 - Fix serious de-duplication bug and a few other things * Fix a serious de-duplication bug. When small files <= 512 bytes are extended with write()s to being larger than 512 bytes, it triggers a de-duplication bug in the first block of the file if that block can be de-duplicated from other sources. A mishandled skip condition combined with modest buffer cache flush loads can cause this first block can wind up getting zero'd out and cause a CHECK failure (I/O error) on the file. The fixes for this are primarily in hammer2_chain_modify(). * Replace HAMMER2_BREF_FLAG_ZERO in the bref.flags with HAMMER2_CHAIN_NOTTESTED in the chain structure and deprecate the flag. This flag could sometimes accidentally be flushed to the media. * Clear HAMMER2_CHAIN_INITIAL in two strategy write paths that are not typically hit. The flag is probably already clear at this point since hammer2_chain_modify() has likely already been called, but be sure. Summary of changes: sys/vfs/hammer2/hammer2.h | 2 +- sys/vfs/hammer2/hammer2_chain.c | 57 +++++++++++++++++++++++++------------- sys/vfs/hammer2/hammer2_disk.h | 2 +- sys/vfs/hammer2/hammer2_io.c | 7 +++-- sys/vfs/hammer2/hammer2_strategy.c | 8 ++++-- 5 files changed, 50 insertions(+), 26 deletions(-) http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/58898c0eb3f3dcaecea7216c70e96b4be4a3ff7f -- DragonFly BSD source repository