reiserfs-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] reiserfs: tree block validation
@ 2017-05-09 20:50 jeffm
  2017-05-09 20:50 ` [PATCH 1/4] reiserfs: constify read-only helpers jeffm
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: jeffm @ 2017-05-09 20:50 UTC (permalink / raw)
  To: reiserfs-devel; +Cc: Jeff Mahoney

From: Jeff Mahoney <jeffm@suse.com>

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-05-09 20:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-09 20:50 [PATCH 0/4] reiserfs: tree block validation jeffm
2017-05-09 20:50 ` [PATCH 1/4] reiserfs: constify read-only helpers jeffm
2017-05-09 20:50 ` [PATCH 2/4] reiserfs: use snprintf for buffer formatting jeffm
2017-05-09 20:50 ` [PATCH 3/4] reiserfs: protect message formatting and printing with mutex jeffm
2017-05-09 20:50 ` [PATCH 4/4] reiserfs: perform tree block sanity checks at read/write jeffm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).