From: Ted Ts'o <tytso@mit.edu>
To: Curt Wohlgemuth <curtw@google.com>
Cc: ext4 development <linux-ext4@vger.kernel.org>,
Jon Nelson <jnelson@jamponi.net>
Subject: Re: ext4: Fix data corruption with multi-block writepages support
Date: Thu, 3 Feb 2011 13:38:55 -0500 [thread overview]
Message-ID: <20110203183854.GA2623@thunk.org> (raw)
In-Reply-To: <AANLkTinadVSGuoZwtNfahxVYneRDUe_4_qpyuoidHoVd@mail.gmail.com>
Thanks, added to the ext4 patch queue.
I modified the commit description slightly to give credit to Jon
Nelson, who reported the bug and really helped by devising a
reproduceable test case. Many thanks, Jon!!
- Ted
ext4: Fix data corruption with multi-block writepages support
From: Curt Wohlgemuth <curtw@google.com>
This fixes a corruption problem with the multi-block
writepages submittal change for ext4, from commit
bd2d0210cf22f2bd0cef72eb97cf94fc7d31d8cc ("ext4: use bio
layer instead of buffer layer in mpage_da_submit_io").
(Note that this corruption is not present in 2.6.37 on
ext4, because the corruption was detected after the
feature was merged in 2.6.37-rc1, and so it was turned
off by adding a non-default mount option,
mblk_io_submit. With this commit, which hopefully
fixes the last of the bugs with this feature, we'll be
able to turn on this performance feature by default in
2.6.38, and remove the mblk_io_submit option.)
The ext4 code path to bundle multiple pages for
writeback in ext4_bio_write_page() had a bug: we should
be clearing buffer head dirty flags *before* we submit
the bio, not in the completion routine.
The patch below was tested on 2.6.37 under KVM with the
postgresql script which was submitted by Jon Nelson as
documented in commit 1449032be1.
Without the patch, I'd hit the corruption problem about
50-70% of the time. With the patch, I executed the
script > 100 times with no corruption seen.
I also fixed a bug to make sure ext4_end_bio() doesn't
dereference the bio after the bio_put() call.
Reported-by: Jon Nelson <jnelson@jamponi.net>
Signed-off-by: Curt Wohlgemuth <curtw@google.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
next prev parent reply other threads:[~2011-02-03 18:39 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-01 17:51 ext4: Fix data corruption with multi-block writepages support Curt Wohlgemuth
2011-02-03 18:38 ` Ted Ts'o [this message]
-- strict thread matches above, loose matches on Subject: below --
2011-02-04 22:40 Matt
2011-02-07 17:45 ` Ted Ts'o
2011-02-07 18:29 ` Milan Broz
2011-02-07 18:44 ` Matt
2011-02-07 20:44 ` Ted Ts'o
2011-02-07 20:51 ` Milan Broz
2011-02-07 18:56 ` Matt
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=20110203183854.GA2623@thunk.org \
--to=tytso@mit.edu \
--cc=curtw@google.com \
--cc=jnelson@jamponi.net \
--cc=linux-ext4@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).