From: Theodore Tso <tytso@mit.edu>
To: ocfs2-devel@oss.oracle.com, linux-ext4@vger.kernel.org
Subject: Re: [PATCH] [RFC] jbd2: Add buffer triggers
Date: Mon, 6 Oct 2008 19:32:48 -0400 [thread overview]
Message-ID: <20081006233248.GA9337@mit.edu> (raw)
In-Reply-To: <20081006214251.GB26632@mail.oracle.com>
On Mon, Oct 06, 2008 at 02:42:52PM -0700, Joel Becker wrote:
> On Mon, Oct 06, 2008 at 02:37:54PM -0700, Joel Becker wrote:
> > On Fri, Oct 03, 2008 at 08:03:36PM -0400, Theodore Tso wrote:
> > Now, I'm sure this is the buffer that's going to the journal, I
> > think you're saying that this buffer may not be what gets checkpointed.
> > So the correct checksum hits the journal, but then an invalid one gets
> > to the real location on disk. Is that right? If so, I need to figure
> > out where to calculate the checksum somewhere higher, as you say.
>
> Ok, looking at your first email again, you're saying to move up
> to the "Check for escaping" section. There we might checksum b_data
> before it's copied out. This is, indeed, safe against the problem you
> mentioned. I also think it's safe to checksum b_frozen_data if already
> set there, as that's a frozen for commit buffer. Can I trust that
> checksumming b_data there will not be overwritten by another process
> doing journal_dirty_metadata() before we write out our buffer? Can I
> trust that the b_frozen_data, if already copied, will be the buffer
> committed and checkpointed? If so, I think that change works.
I'm not 100% sure..... The other area that we should check very
closely is jbd2_journal_commit_transaction(); in some cases, if
jh->b_committed_data is NULL, the frozen data is thrown away (around
line 850 in transaction.c). I *think* this happens if b_frozen_data
was only copied to escape the buffer, but I'm not certain; in any
case, there's a potential that in that case you might lose the
calculated checksum and the correct value wouldn't get written to the
final location on disk.
There are parts of the jbd2 code which badly needs someone with time
to go through, grok it entirely and then write up how various bits and
pieces work. Andrew Morton is right; Stephen Tweedie wrote some
*very* clever code, and part of the problem is probably no one can
understand some of the more subtle bits off the cuff, and few can
understand it only after spend a while wrapping their minds around how
it all works. So I suspect one of is going to have take a deep dive
into the code, grok how the trifecta of b_committed_data,
b_frozen_data, and b_data interact, and which functions make what
assumptions, and then write up a lot of explanatory documentation....
Unfortunately, I'm not sure I'm going to have time for at least the
next couple of weeks. Do you think you could take a crack at it?
- Ted
next prev parent reply other threads:[~2008-10-06 23:32 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-17 23:26 [PATCH] [RFC] jbd2: Add buffer triggers Joel Becker
2008-09-17 23:27 ` [PATCH] ocfs2: Use the new jbd_journal_set_triggers() to printk Joel Becker
2008-09-19 21:46 ` [PATCH] [RFC] jbd2: Add buffer triggers Andreas Dilger
2008-09-20 3:36 ` [Ocfs2-devel] " Joel Becker
2008-09-29 1:25 ` Theodore Tso
2008-10-04 0:03 ` Theodore Tso
2008-10-06 21:37 ` Joel Becker
2008-10-06 21:42 ` Joel Becker
2008-10-06 23:32 ` Theodore Tso [this message]
2008-10-07 1:01 ` [Ocfs2-devel] " Joel Becker
2008-10-08 23:17 ` Joel Becker
2008-10-16 17:42 ` Theodore Tso
2008-10-16 19:40 ` Joel Becker
2008-10-16 19:44 ` Joel Becker
2008-10-17 12:28 ` [Ocfs2-devel] " Theodore Tso
2008-10-17 17:11 ` Mark Fasheh
2008-10-07 1:04 ` Joel Becker
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=20081006233248.GA9337@mit.edu \
--to=tytso@mit.edu \
--cc=linux-ext4@vger.kernel.org \
--cc=ocfs2-devel@oss.oracle.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).