From: Joel Becker <Joel.Becker@oracle.com>
To: Theodore Tso <tytso@mit.edu>
Cc: ocfs2-devel@oss.oracle.com, linux-ext4@vger.kernel.org
Subject: Re: [PATCH] [RFC] jbd2: Add buffer triggers
Date: Mon, 6 Oct 2008 14:37:55 -0700 [thread overview]
Message-ID: <20081006213754.GA26632@mail.oracle.com> (raw)
In-Reply-To: <20081004000336.GE11442@mit.edu>
On Fri, Oct 03, 2008 at 08:03:36PM -0400, Theodore Tso wrote:
> I'm not sure you saw this e-mail, since I think it got in a mailman
> moderation queue.
I've flagged you as "do not moderate". I saw the email, but I
was in Prague for the cluster summit and didn't have time to look
in-depth.
> I've been looking more closely at this, and I think actually using
> this commit trigger gets very tricky. Exactly how do you plan to use
> the commit trigger? The caller is only going to be able to easily
> check the checksum on the frozen copy of the buffer; is that what you
> intended? When and how do you plan set the checksum for a filesystem
> which is cleanly unmounted? And are you planning on doing this for
> just the superblock, or for other data structures?
Every single metadata block in ocfs2 would have the commit
trigger set. I intend to calculate the block checksums in the trigger.
That way I only compute the checksum once per journal write, rather than
every time I call journal_dirty_metadata(). That's my plan, at least.
You may be right that my choice is too late and that I need to
trigger in an earlier place. That's why I was taking time to reply: I
wanted to re-read the jbd2 source and be sure of what you were saying
and how I was handling it. I haven't looked yet (just got back to the
office today), but here's what I understand so far.
As far I could tell, actual writes of the buffer to the journal
go through journal_write_metadata_buffer(). Only in
journal_write_metadata_buffer() are you sure to have a frozen copy of
the buffer that won't be affected by parallel processes doing
journal_dirty_metadata(). Thus, the new_page and new_offset values are
set to b_data or b_frozen_data as needed. When I get past that, I have
the right pointer. I need to do it before the escape, of course,
because I want to checksum the block data, not the escaped data.
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.
Joel
--
"Nobody loves me,
Nobody seems to care.
Troubles and worries, people,
You know I've had my share."
Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker@oracle.com
Phone: (650) 506-8127
WARNING: multiple messages have this Message-ID (diff)
From: Joel Becker <Joel.Becker@oracle.com>
To: Theodore Tso <tytso@mit.edu>
Cc: ocfs2-devel@oss.oracle.com, linux-ext4@vger.kernel.org
Subject: [Ocfs2-devel] [PATCH] [RFC] jbd2: Add buffer triggers
Date: Mon, 6 Oct 2008 14:37:55 -0700 [thread overview]
Message-ID: <20081006213754.GA26632@mail.oracle.com> (raw)
In-Reply-To: <20081004000336.GE11442@mit.edu>
On Fri, Oct 03, 2008 at 08:03:36PM -0400, Theodore Tso wrote:
> I'm not sure you saw this e-mail, since I think it got in a mailman
> moderation queue.
I've flagged you as "do not moderate". I saw the email, but I
was in Prague for the cluster summit and didn't have time to look
in-depth.
> I've been looking more closely at this, and I think actually using
> this commit trigger gets very tricky. Exactly how do you plan to use
> the commit trigger? The caller is only going to be able to easily
> check the checksum on the frozen copy of the buffer; is that what you
> intended? When and how do you plan set the checksum for a filesystem
> which is cleanly unmounted? And are you planning on doing this for
> just the superblock, or for other data structures?
Every single metadata block in ocfs2 would have the commit
trigger set. I intend to calculate the block checksums in the trigger.
That way I only compute the checksum once per journal write, rather than
every time I call journal_dirty_metadata(). That's my plan, at least.
You may be right that my choice is too late and that I need to
trigger in an earlier place. That's why I was taking time to reply: I
wanted to re-read the jbd2 source and be sure of what you were saying
and how I was handling it. I haven't looked yet (just got back to the
office today), but here's what I understand so far.
As far I could tell, actual writes of the buffer to the journal
go through journal_write_metadata_buffer(). Only in
journal_write_metadata_buffer() are you sure to have a frozen copy of
the buffer that won't be affected by parallel processes doing
journal_dirty_metadata(). Thus, the new_page and new_offset values are
set to b_data or b_frozen_data as needed. When I get past that, I have
the right pointer. I need to do it before the escape, of course,
because I want to checksum the block data, not the escaped data.
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.
Joel
--
"Nobody loves me,
Nobody seems to care.
Troubles and worries, people,
You know I've had my share."
Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127
next prev parent reply other threads:[~2008-10-06 21:38 UTC|newest]
Thread overview: 34+ 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:26 ` [Ocfs2-devel] " Joel Becker
2008-09-17 23:27 ` [PATCH] ocfs2: Use the new jbd_journal_set_triggers() to printk Joel Becker
2008-09-17 23:27 ` [Ocfs2-devel] " Joel Becker
2008-09-19 21:46 ` [PATCH] [RFC] jbd2: Add buffer triggers Andreas Dilger
2008-09-19 21:46 ` [Ocfs2-devel] " Andreas Dilger
2008-09-20 3:36 ` Joel Becker
2008-09-20 3:36 ` Joel Becker
2008-09-29 1:25 ` Theodore Tso
2008-09-29 1:25 ` [Ocfs2-devel] " Theodore Tso
2008-10-04 0:03 ` Theodore Tso
2008-10-04 0:03 ` [Ocfs2-devel] " Theodore Tso
2008-10-06 21:37 ` Joel Becker [this message]
2008-10-06 21:37 ` Joel Becker
2008-10-06 21:42 ` Joel Becker
2008-10-06 21:42 ` [Ocfs2-devel] " Joel Becker
2008-10-06 23:32 ` Theodore Tso
2008-10-06 23:32 ` [Ocfs2-devel] " Theodore Tso
2008-10-07 1:01 ` Joel Becker
2008-10-07 1:01 ` Joel Becker
2008-10-08 23:17 ` Joel Becker
2008-10-08 23:17 ` Joel Becker
2008-10-16 17:42 ` Theodore Tso
2008-10-16 17:42 ` Theodore Tso
2008-10-16 19:40 ` Joel Becker
2008-10-16 19:40 ` Joel Becker
2008-10-16 19:44 ` Joel Becker
2008-10-16 19:44 ` [Ocfs2-devel] " Joel Becker
2008-10-17 12:28 ` Theodore Tso
2008-10-17 12:28 ` Theodore Tso
2008-10-17 17:11 ` Mark Fasheh
2008-10-17 17:11 ` Mark Fasheh
2008-10-07 1:04 ` Joel Becker
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=20081006213754.GA26632@mail.oracle.com \
--to=joel.becker@oracle.com \
--cc=linux-ext4@vger.kernel.org \
--cc=ocfs2-devel@oss.oracle.com \
--cc=tytso@mit.edu \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.