public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/3] ext4: fix ZERO_RANGE test failure in data journalling mode
@ 2014-04-16 22:29 Namjae Jeon
  2014-04-17  8:53 ` Lukáš Czerner
  0 siblings, 1 reply; 10+ messages in thread
From: Namjae Jeon @ 2014-04-16 22:29 UTC (permalink / raw)
  To: Theodore Ts'o; +Cc: linux-ext4, Lukáš Czerner

From: Namjae Jeon <namjae.jeon@samsung.com>

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 | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index f386dd6..a64242f 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -4742,6 +4742,13 @@ static long ext4_zero_range(struct file *file, loff_t offset,
 
 	trace_ext4_zero_range(inode, offset, len, mode);
 
+	/* 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 to avoid race conditions
 	 * Then release them.
-- 
1.7.11-rc0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2014-04-19  2:40 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox