add patch fix-zeroing-of-page-during-writeback
[ext4-patch-queue.git] / fix-ZERO_RANGE-test-failure-in-data-journalling
blob9b1e35009f6e9b94a1c5fd17ad30cfbb9fa0f272
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
8 collapse range.
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>
13 ---
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);
28 +               if (ret) {
29 +                       mutex_unlock(&EXT4_I(inode)->i_write_mutex);
30 +                       return ret;
31 +               }
32 +       }
34         /*
35          * Write out all dirty pages to avoid race conditions
36          * Then release them.
37 -- 
38 1.7.11-rc0
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