From: Namjae Jeon <namjae.jeon@samsung.com>
To: 'Theodore Ts'o' <tytso@mit.edu>
Cc: "'Lukáš Czerner'" <lczerner@redhat.com>,
"'Jan Kara'" <jack@suse.cz>,
'linux-ext4' <linux-ext4@vger.kernel.org>
Subject: RE: [PATCH 2/3] ext4: fix ZERO_RANGE test failure in data journalling mode
Date: Sat, 19 Apr 2014 11:40:35 +0900 [thread overview]
Message-ID: <000b01cf5b78$bde469e0$39ad3da0$@samsung.com> (raw)
In-Reply-To: <20140418143711.GA19131@thunk.org>
> So a couple of things. First of all, ext4_force_commit() is a very
> expensive call, so calling it twice is really not a good idea.
Yes, Right.
>
> Secondly, in the ext4_collapse_range() you are calling
> ext4_force_commit() before filemap_write_and_wait_range().
>
> /* Call ext4_force_commit to flush all data in case of data=journal. */
> if (ext4_should_journal_data(inode)) {
> ret = ext4_force_commit(inode->i_sb);
> if (ret)
> return ret;
> }
>
> /* Write out all dirty pages */
> ret = filemap_write_and_wait_range(inode->i_mapping, offset, -1);
> if (ret)
> return ret;
>
> Shouldn't we reverse these two calls?
Yes, The original problem will occur again if we reverse these calls.
ext4_force_commit will mark the buffers as dirty during commit transcation.
So we should sync it using filemap_write_and_wait_range later.
>
> Finally, I'm wondering if we would be better off creating a new
> explicit EXT4_I(inode)->i_write_mutex which is used to block new
> writes from starting. This could also be used to subsume the
> ext4_aio_mutex.
Right. It is better method. I will check your point. :)
Thanks Ted!!
>
> - Ted
prev parent reply other threads:[~2014-04-19 2:40 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-16 22:29 [PATCH 2/3] ext4: fix ZERO_RANGE test failure in data journalling mode Namjae Jeon
2014-04-17 8:53 ` Lukáš Czerner
2014-04-17 10:52 ` Namjae Jeon
2014-04-17 11:00 ` Lukáš Czerner
2014-04-17 12:01 ` Namjae Jeon
2014-04-17 12:16 ` Lukáš Czerner
2014-04-18 1:41 ` Namjae Jeon
2014-04-18 14:37 ` Theodore Ts'o
2014-04-18 16:25 ` Lukáš Czerner
2014-04-19 2:40 ` Namjae Jeon [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='000b01cf5b78$bde469e0$39ad3da0$@samsung.com' \
--to=namjae.jeon@samsung.com \
--cc=jack@suse.cz \
--cc=lczerner@redhat.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