Skip to content

reiserfs: tree block validation

[email protected] reiserfs-devel 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4reiserfs: constify read-only helpersfs/reiserfs/prints.c fs/reiserfs/reiserfs.h fs/reiserfs/super.c+28 -250 replies
2/4reiserfs: use snprintf for buffer formattingfs/reiserfs/prints.c+138 -750 replies
3/4reiserfs: protect message formatting and printing with mutexfs/reiserfs/prints.c+19 -70 replies
4/4reiserfs: perform tree block sanity checks at read/writefs/reiserfs/do_balan.c fs/reiserfs/fix_node.c fs/reiserfs/inode.c +5 more+447 -160 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/4] reiserfs: tree block validation

From: Jeff Mahoney <[email protected]>

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(-)
Signature · 1 line
2.11.0