linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Josef Bacik <josef@redhat.com>
To: Andrey Kuzmin <andrey.v.kuzmin@gmail.com>
Cc: Josef Bacik <josef@redhat.com>, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] Btrfs: check items for correctness as we search
Date: Wed, 16 Mar 2011 14:29:13 -0400	[thread overview]
Message-ID: <20110316182913.GB2510@localhost.localdomain> (raw)
In-Reply-To: <AANLkTikTnYr8hPWCQpVFBzHyA9gSPijiiRv5LBXXpeti@mail.gmail.com>

On Wed, Mar 16, 2011 at 09:23:58PM +0300, Andrey Kuzmin wrote:
> On Wed, Mar 16, 2011 at 8:44 PM, Josef Bacik <josef@redhat.com> wrote:
> 
> > Currently if we have corrupted items things will blow up in spectacular
> > ways.
> > So as we search check the item that we are pointing at currently to make
> > sure it
> >
> 
> Will these checks run multiple times on the same slot? If yes, why not have
> an in-memory bit 'checked' and skip checks of already checked items? Or
> simply check once when loading from disk?
> 

I thought about this but I have some reservations.  In order to make sure the
block is actually right we'd have to check the entire thing when it's read from
disk, which isn't too bad, but what happens when only one item in the block is
corrupt?  For example if just the xattr item for an inode is corrupt, this
method would keep you from reading the inode item in the same block which could
be just fine.  If this is acceptable for everybody then I don't mind doing it
this way, but the current implementation makes sure we only check what we are
actually interested in so we can have the best possible chance of limping along
if only part of the block is bogus.  Thanks,

Josef

  parent reply	other threads:[~2011-03-16 18:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-16 17:44 [PATCH] Btrfs: check items for correctness as we search Josef Bacik
     [not found] ` <AANLkTikTnYr8hPWCQpVFBzHyA9gSPijiiRv5LBXXpeti@mail.gmail.com>
2011-03-16 18:29   ` Josef Bacik [this message]
     [not found]     ` <AANLkTi=CAuTL-wH-KmnqhoJH1hHhucFOzSukE5rJ2PUf@mail.gmail.com>
2011-03-16 18:54       ` Josef Bacik
  -- strict thread matches above, loose matches on Subject: below --
2011-03-16 20:04 Josef Bacik
2011-03-16 20:50 ` Chris Mason
2011-03-16 21:05   ` Josef Bacik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110316182913.GB2510@localhost.localdomain \
    --to=josef@redhat.com \
    --cc=andrey.v.kuzmin@gmail.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).