linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakob Oestergaard <jakob@unthought.net>
To: "Stephen C. Tweedie" <sct@redhat.com>
Cc: linux-kernel@vger.kernel.org, Andrew Morton <akpm@zip.com.au>
Subject: Re: jbd bug(s) (?)
Date: Thu, 26 Sep 2002 14:56:47 +0200	[thread overview]
Message-ID: <20020926125647.GT2442@unthought.net> (raw)
In-Reply-To: <20020926132723.D2721@redhat.com>

On Thu, Sep 26, 2002 at 01:27:23PM +0100, Stephen C. Tweedie wrote:
> Hi,

Hi !

...
> 
> The index is only updated when we purge stuff out of the journal.

Yes, of course.

> That can still be quite frequent on a really busy journal, but it's
> definitely not a required part of a transaction.  

No, but the correct writing of your index is a required part for the
successful re-play at recovery.

You can't re-play if you can't find the beginning of your journal  :)

Just *imagine* that half your index was written successfully to disk and
then the power failed.   That was what I imagined could happen.

Quite some people have pointed out to me by now, that I was wrong - so
don't worry about it  :)

> 
> That's deliberate --- the ext3 journal is designed to be written as
> sequentially as possible, so seeking to the index block is an expense
> which we try to avoid.

Of course - any sane journal should be designed that way.

> 
> > RAID wouldn't save me in the case where the journal index is screwed due
> > to a partial sector write and a power loss.
> 
> A partial sector write is essentially impossible.  It's unlikely that
> the data on disk would be synchronised beyond the point at which the
> write stopped, and even if it was, the CRC would be invalid, so you'd
> get a bad sector error return on subsequent attempts to read that data
> --- you'd not be given silently corrupt data.

I know.  What I imagined was, that there were disks out there which
*internally* worked with smaller sector sizes, and merely presented a
512 byte sector to the outside world.

That way, it would be perfecly possible for a disk to write 2 bytes of
your index pointer along with it's error correction codes and what not.
And it would be perfectly possible for it to return an invalid index
pointer (2 bytes of your new pointer, the remaining bytes from the old
pointer) - without returning a read error.

Let's hope that none of the partitioning formats or LVM projects out
there will misalign the filesystem so that your index actually *does*
cross a 512 byte boundary   ;)

> Making parts of the disk suddenly unreadable on power-fail is
> generally considered a bad thing, though, so modern disks go to great
> lengths to ensure the write finishes.

Lucky us  :)


 Cheers,

-- 
................................................................
:   jakob@unthought.net   : And I see the elder races,         :
:.........................: putrid forms of man                :
:   Jakob Østergaard      : See him rise and claim the earth,  :
:        OZ9ABN           : his downfall is at hand.           :
:.........................:............{Konkhra}...............:

  reply	other threads:[~2002-09-26 12:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-24  7:21 jbd bug(s) (?) Jakob Oestergaard
2002-09-25 16:36 ` Stephen C. Tweedie
2002-09-26 12:21   ` Jakob Oestergaard
2002-09-26 12:27     ` Stephen C. Tweedie
2002-09-26 12:56       ` Jakob Oestergaard [this message]
2002-09-26 13:44         ` Theodore Ts'o
2002-09-26 14:05           ` Christoph Hellwig
2002-09-26 14:25             ` Theodore Ts'o
2002-09-26 14:41               ` Christoph Hellwig

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=20020926125647.GT2442@unthought.net \
    --to=jakob@unthought.net \
    --cc=akpm@zip.com.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sct@redhat.com \
    /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).