[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1396881675-7272-1-git-send-email-linkinjeon@gmail.com>
Date: Mon, 7 Apr 2014 23:41:15 +0900
From: Namjae Jeon <linkinjeon@...il.com>
To: tytso@....edu
Cc: linux-ext4@...r.kernel.org, Namjae Jeon <linkinjeon@...il.com>,
Namjae Jeon <namjae.jeon@...sung.com>,
Ashish Sangwan <a.sangwan@...sung.com>
Subject: [PATCH] ext4: fix shared/002 and 004 fail issue in xfstests
From: Namjae Jeon <namjae.jeon@...sung.com>
When mounting ext4 with data=journal option, shared/002 and 004 are
failed on xfstests. Calling ext4_force_commit before
filemap_write_and_wait_range is needed to flush all data into journal
on this case.
Signed-off-by: Namjae Jeon <namjae.jeon@...sung.com>
Signed-off-by: Ashish Sangwan <a.sangwan@...sung.com>
---
fs/ext4/extents.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 243a02e..dc9333f 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -5375,6 +5375,13 @@ int ext4_collapse_range(struct inode *inode, loff_t offset, loff_t len)
punch_start = offset >> EXT4_BLOCK_SIZE_BITS(sb);
punch_stop = (offset + len) >> EXT4_BLOCK_SIZE_BITS(sb);
+ /* 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 */
ret = filemap_write_and_wait_range(inode->i_mapping, offset, -1);
if (ret)
--
1.7.9.5
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists