1 ext4: fix ZERO_RANGE test failure in data journalling
3 From: Namjae Jeon <namjae.jeon@samsung.com>
5 xfstests generic/091 is failing when mounting ext4 with data=journal.
6 I think that this regression is same problem that occurred prior to collapse
7 range issue. So ZERO RANGE also need to call ext4_force_commit as
10 Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
11 Signed-off-by: Ashish Sangwan <a.sangwan@samsung.com>
12 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
14 fs/ext4/extents.c | 9 +++++++++
15 1 file changed, 9 insertions(+)
17 diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
18 index 1c5e877..02143d6 100644
19 --- a/fs/ext4/extents.c
20 +++ b/fs/ext4/extents.c
21 @@ -4743,6 +4743,15 @@ static long ext4_zero_range(struct file *file, loff_t offset,
23 mutex_lock(&EXT4_I(inode)->i_write_mutex);
25 + /* Call ext4_force_commit to flush all data in case of data=journal. */
26 + if (ext4_should_journal_data(inode)) {
27 + ret = ext4_force_commit(inode->i_sb);
29 + mutex_unlock(&EXT4_I(inode)->i_write_mutex);
35 * Write out all dirty pages to avoid race conditions
41 To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
42 the body of a message to majordomo@vger.kernel.org
43 More majordomo info at http://vger.kernel.org/majordomo-info.html