From: Jeff Mahoney <jeffm@xxxxxxxx> Hi all - Over the years, I've received bug reports that mostly fall under the fuzzer heading and were relatively low priority since physical access to the hardware was required to actually get the corrupted file system mounted. Those days are long over and real validation is required. Reiserfs has had the CONFIG_REISERFS_CHECK mode since the beginning to do some sanity checking, but it's usually so heavyweight that it becomes a performance impediment. This patch set takes care of a few outstanding issues: 1) fixes the print formatting so that we don't end up with multiple threads accessing the error_buf at once. Only one thread can change it, but another thread can overwrite it while another is printing it. 2) Adds tree block validation during media read and immediately before the block lands in the journal. In this way, we can ensure we get an EIO instead of malformed records that can cause failures later. The impetus, for me, is a real corruption bug that ended up crashing a system. This doesn't identify the corruption but it does limit the damage it can cause. I'm working on a followup patch to this series that cleans up the journal dirtying in the tree balance code so that we can invoke the validator in journal_mark_tree_block_dirty instead of waiting for commit. Then we will be able to more or less pinpoint corruption immediately. I have no target date for the completion of that work yet, so I wanted to post these now. -Jeff Jeff Mahoney (4): reiserfs: constify read-only helpers reiserfs: use snprintf for buffer formatting reiserfs: protect message formatting and printing with mutex reiserfs: perform tree block sanity checks at read/write fs/reiserfs/do_balan.c | 7 +- fs/reiserfs/fix_node.c | 4 +- fs/reiserfs/inode.c | 6 +- fs/reiserfs/journal.c | 42 +++++- fs/reiserfs/namei.c | 6 +- fs/reiserfs/prints.c | 253 ++++++++++++++++++++++----------- fs/reiserfs/reiserfs.h | 57 +++++--- fs/reiserfs/stree.c | 372 ++++++++++++++++++++++++++++++++++++++++++++++++- fs/reiserfs/super.c | 8 +- 9 files changed, 632 insertions(+), 123 deletions(-) -- 2.11.0 -- To unsubscribe from this list: send the line "unsubscribe reiserfs-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html