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: Sun, 28 Sep 2008 21:25:27 -0400 [thread overview]
Message-ID: <20080929012527.GI8711@mit.edu> (raw)
In-Reply-To: <20080917232629.GB20752@mail.oracle.com>
On Wed, Sep 17, 2008 at 04:26:30PM -0700, Joel Becker wrote:
> Filesystems often to do compute intensive operation on some
> metadata. If this operation is repeated many times, it can be very
> expensive. It would be much nicer if the operation could be performed
> once before a buffer goes to disk.
Sorry for the delay in reviewing this patch, but I've got a question.
Right now you are calling the commit trigger *after* doing the escape
data copying. This means that if the commit trigger is going to
modify the buffer (in the case of the checksum being stored in-line in
the block, which I gather is the case in OCFS2, right?), if you get
unlucky and the block begins with the four bytes JBD2_MAGIC_NUMBER,
then the checksum will be in the value which gets written out to the
log, but *not* to the value in the buffer head that will ultimately
get written to the final location on disk. In the normal case where
the journal wraps and then truncated, it means the checksum will never
get written to the disk. That seems bad. :-)
I believe the correct location to fire the per-buffer commit trigger
is right after the first kmap_atomic, right before the comment "Check
for escaping". This also fixes the bug where if the checksum is
stored in the first four bytes of the block, in the case where you
have bad luck and the checksum == JBD2_MAGIC_NUMBER, you won't end up
with a corrupted journal.
Do you agree? If so, please let me know and I can fix up the patch,
or just submit to me an updated patch.
Thanks,
- Ted
WARNING: multiple messages have this Message-ID (diff)
From: Theodore Tso <tytso@mit.edu>
To: ocfs2-devel@oss.oracle.com, linux-ext4@vger.kernel.org
Subject: [Ocfs2-devel] [PATCH] [RFC] jbd2: Add buffer triggers
Date: Sun, 28 Sep 2008 21:25:27 -0400 [thread overview]
Message-ID: <20080929012527.GI8711@mit.edu> (raw)
In-Reply-To: <20080917232629.GB20752@mail.oracle.com>
On Wed, Sep 17, 2008 at 04:26:30PM -0700, Joel Becker wrote:
> Filesystems often to do compute intensive operation on some
> metadata. If this operation is repeated many times, it can be very
> expensive. It would be much nicer if the operation could be performed
> once before a buffer goes to disk.
Sorry for the delay in reviewing this patch, but I've got a question.
Right now you are calling the commit trigger *after* doing the escape
data copying. This means that if the commit trigger is going to
modify the buffer (in the case of the checksum being stored in-line in
the block, which I gather is the case in OCFS2, right?), if you get
unlucky and the block begins with the four bytes JBD2_MAGIC_NUMBER,
then the checksum will be in the value which gets written out to the
log, but *not* to the value in the buffer head that will ultimately
get written to the final location on disk. In the normal case where
the journal wraps and then truncated, it means the checksum will never
get written to the disk. That seems bad. :-)
I believe the correct location to fire the per-buffer commit trigger
is right after the first kmap_atomic, right before the comment "Check
for escaping". This also fixes the bug where if the checksum is
stored in the first four bytes of the block, in the case where you
have bad luck and the checksum == JBD2_MAGIC_NUMBER, you won't end up
with a corrupted journal.
Do you agree? If so, please let me know and I can fix up the patch,
or just submit to me an updated patch.
Thanks,
- Ted
next prev parent reply other threads:[~2008-09-29 1:25 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 [this message]
2008-09-29 1:25 ` 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
2008-10-06 21:37 ` [Ocfs2-devel] " 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=20080929012527.GI8711@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 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.