linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Eunji Lee <alicia0729@gmail.com>
Cc: linux-ext4@vger.kernel.org, tytso@mit.edu
Subject: Re: [PATCH] fix jbd2 asynchronous commit
Date: Sat, 24 Oct 2015 21:40:17 +0200	[thread overview]
Message-ID: <20151024194017.GB17642@quack.suse.cz> (raw)
In-Reply-To: <14b201d10e33$fb91c390$f2b54ab0$@gmail.com>

On Sat 24-10-15 17:14:15, Eunji Lee wrote:
> This patch is to fix a (seemingly) bug of asynchronous commit process
> (pinging w/ a patch). 
> 
> In asynchronous commit, JBD2 issues a "FLUSH" request only once after
> issuing a commit record if a file system and a journal reside on the same
> device. This can reduce redundant storage flushes relying on the checksum. 
> 
> However, it seems to incur an undesirable result in ordered mode.
> Specifically, the system can crash after metadata blocks and a commit record
> are successfully written to the journal (i.e., with no checksum error), but
> before data blocks are reflected to the file system. Then, on the system
> recovery, metadata updates in a journal area will be replayed as the
> checksum has no error, even though the associated data blocks are not
> reflected to the file system. This fails to provide the correct ordering -
> associated data blocks are written before metadata updates are written. 
> 
> This patch flushes a storage device before issuing a commit record, even if
> a journal and a file system use a same device, thereby guaranteeing the
> correct ordering between metadata and data block updates. 
> 
> Without asynchronous commit, it does not matter because the commit record
> with WRITE_FUA guarantees to flush storage cache before the commit record is
> written to the journal. 

Thanks for your report and detailed analysis. However this bug is already
fixed - parse_options() in fs/ext4/super.c already makes sure that
journal_async_commit cannot be enabled in data=ordered mode.

								Honza
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

      reply	other threads:[~2015-10-25  4:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-24  8:14 [PATCH] fix jbd2 asynchronous commit Eunji Lee
2015-10-24 19:40 ` Jan Kara [this message]

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=20151024194017.GB17642@quack.suse.cz \
    --to=jack@suse.cz \
    --cc=alicia0729@gmail.com \
    --cc=linux-ext4@vger.kernel.org \
    --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 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).