aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNamjae Jeon <namjae.jeon@samsung.com>2014-05-27 12:48:55 -0400
committerTheodore Ts'o <tytso@mit.edu>2014-05-27 12:48:55 -0400
commite1ee60fd89670da61b0a4bda59f8ffb2b8abea63 (patch)
treedca4e245a9c924ec2457581ea04cde8b43cbc56b
parentd745a8c20c1f864c10ca78d0f89219633861b7e9 (diff)
ext4: fix ZERO_RANGE test failure in data journalling
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. Cc: stable@vger.kernel.org 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>
-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 5bbe425640da..4da228a0e6d0 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -4741,6 +4741,13 @@ static long ext4_zero_range(struct file *file, loff_t offset,
4741 if (!S_ISREG(inode->i_mode)) 4741 if (!S_ISREG(inode->i_mode))
4742 return -EINVAL; 4742 return -EINVAL;
4743 4743
4744 /* Call ext4_force_commit to flush all data in case of data=journal. */
4745 if (ext4_should_journal_data(inode)) {
4746 ret = ext4_force_commit(inode->i_sb);
4747 if (ret)
4748 return ret;
4749 }
4750
4744 /* 4751 /*
4745 * Write out all dirty pages to avoid race conditions 4752 * Write out all dirty pages to avoid race conditions
4746 * Then release them. 4753 * Then release them.