summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorNamjae Jeon <namjae.jeon@samsung.com>2014-05-27 12:48:55 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-06-30 20:13:56 -0700
commit59bc864486f20859e51b2878686fb86cfd57384c (patch)
tree0ac861fff644271e60f6e399d09fa4cc0d7ef253 /fs
parentf70b5876eb95d2d96c0061f6f32524669f9818ec (diff)
ext4: fix ZERO_RANGE test failure in data journalling
commit e1ee60fd89670da61b0a4bda59f8ffb2b8abea63 upstream. 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> Signed-off-by: Theodore Ts'o <tytso@mit.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/ext4/extents.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 01b0c208f625..f312c47b7d18 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -4744,6 +4744,13 @@ static long ext4_zero_range(struct file *file, loff_t offset,
if (!S_ISREG(inode->i_mode))
return -EINVAL;
+ /* 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.