From: Namjae Jeon <namjae.jeon@samsung.com>
To: Theodore Ts'o <tytso@mit.edu>
Cc: linux-ext4 <linux-ext4@vger.kernel.org>,
"Lukáš Czerner" <lczerner@redhat.com>,
"Ashish Sangwan" <a.sangwan@samsung.com>
Subject: [PATCH 2/2] ext4: fix ZERO_RANGE test failure in data journalling
Date: Tue, 13 May 2014 09:10:55 +0900 [thread overview]
Message-ID: <001401cf6e3f$cf49f7c0$6ddde740$@samsung.com> (raw)
xfstests generic/091 is failing when mounting ext4 with data=journal.
I think that this regression is same problem that occurred prior to collapse
range issue. So ZERO RANGE also need to call ext4_force_commit as
collapse range.
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: Ashish Sangwan <a.sangwan@samsung.com>
---
fs/ext4/extents.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 1c5e877..02143d6 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -4743,6 +4743,15 @@ static long ext4_zero_range(struct file *file, loff_t offset,
mutex_lock(&EXT4_I(inode)->i_write_mutex);
+ /* 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) {
+ mutex_unlock(&EXT4_I(inode)->i_write_mutex);
+ return ret;
+ }
+ }
+
/*
* Write out all dirty pages to avoid race conditions
* Then release them.
--
1.7.11-rc0
next reply other threads:[~2014-05-13 0:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-13 0:10 Namjae Jeon [this message]
2014-05-26 16:29 ` [PATCH 2/2] ext4: fix ZERO_RANGE test failure in data journalling Theodore Ts'o
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='001401cf6e3f$cf49f7c0$6ddde740$@samsung.com' \
--to=namjae.jeon@samsung.com \
--cc=a.sangwan@samsung.com \
--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;
as well as URLs for NNTP newsgroup(s).