From: Theodore Ts'o <tytso@mit.edu>
To: Daeho Jeong <daeho.jeong@samsung.com>
Cc: linux-ext4@vger.kernel.org, daehojng@gmail.com
Subject: Re: [PATCH] ext4: remove filemap_fdatawrite() when synchronizing a data journaled file
Date: Tue, 28 Jul 2015 08:07:13 -0400 [thread overview]
Message-ID: <20150728120712.GH2851@thunk.org> (raw)
In-Reply-To: <1046256826.88691438049846580.JavaMail.weblogic@epmlwas02d>
On Tue, Jul 28, 2015 at 02:17:26AM +0000, Daeho Jeong wrote:
> When fsync() system call is executed, all data of the file should be written on the storage.
> But, in a case of that the file is operated in data journal mode, the data doesn't need to be
> flushed out and waited for its I/O completion. Moreover, by invoking filemap_fdatawrite()
> function on the data journaled file, ext4_sync_file() suffers from an unnecessary delay
> which is caused by flushing out and waiting for the I/O completion of a ton of newly-dirtied
> pages which were dirtied by the previous commit.
No, this patch is incorrect. Data journalling works by having the
buffers getting dirtied, and that doesn't happen until we call
filemap_fdatawrite_range(). It's true that we don't have to call
filemap_write_and_wait_range(), but simply skipping the writeback
entirely will cause data writes to get lost after an fsync() if we
crash immediately afterwards.
I'm guessing you didn't actually test this patch for correctness?
- Ted
prev parent reply other threads:[~2015-07-28 12:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-28 2:17 [PATCH] ext4: remove filemap_fdatawrite() when synchronizing a data journaled file Daeho Jeong
2015-07-28 12:07 ` Theodore Ts'o [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=20150728120712.GH2851@thunk.org \
--to=tytso@mit.edu \
--cc=daeho.jeong@samsung.com \
--cc=daehojng@gmail.com \
--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).