Skip to content

Commit e1ee60f

Browse files
Namjae Jeontytso
authored andcommitted
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>
1 parent d745a8c commit e1ee60f

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎fs/ext4/extents.c‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4741,6 +4741,13 @@ static long ext4_zero_range(struct file *file, loff_t offset,
47414741
if (!S_ISREG(inode->i_mode))
47424742
return -EINVAL;
47434743

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+
47444751
/*
47454752
* Write out all dirty pages to avoid race conditions
47464753
* Then release them.

0 commit comments

Comments
 (0)