linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ext4: fix shared/002 and 004 fail issue in xfstests
@ 2014-04-07 14:41 Namjae Jeon
  2014-04-07 16:25 ` Theodore Ts'o
  0 siblings, 1 reply; 3+ messages in thread
From: Namjae Jeon @ 2014-04-07 14:41 UTC (permalink / raw)
  To: tytso; +Cc: linux-ext4, Namjae Jeon, Namjae Jeon, Ashish Sangwan

From: Namjae Jeon <namjae.jeon@samsung.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@samsung.com>
Signed-off-by: Ashish Sangwan <a.sangwan@samsung.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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ext4: fix shared/002 and 004 fail issue in xfstests
  2014-04-07 14:41 [PATCH] ext4: fix shared/002 and 004 fail issue in xfstests Namjae Jeon
@ 2014-04-07 16:25 ` Theodore Ts'o
  2014-04-07 23:12   ` Namjae Jeon
  0 siblings, 1 reply; 3+ messages in thread
From: Theodore Ts'o @ 2014-04-07 16:25 UTC (permalink / raw)
  To: Namjae Jeon; +Cc: linux-ext4, Namjae Jeon, Ashish Sangwan

On Mon, Apr 07, 2014 at 11:41:15PM +0900, Namjae Jeon wrote:
> From: Namjae Jeon <namjae.jeon@samsung.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.

Hi Namjae,

Thanks for working for this!

Could you include in your commit description of why adding a call to
ext4_force_commit() is necessary to avoid the problem, and what wa
going wrong in the data=journal case?

Thanks,

					- Ted

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ext4: fix shared/002 and 004 fail issue in xfstests
  2014-04-07 16:25 ` Theodore Ts'o
@ 2014-04-07 23:12   ` Namjae Jeon
  0 siblings, 0 replies; 3+ messages in thread
From: Namjae Jeon @ 2014-04-07 23:12 UTC (permalink / raw)
  To: Theodore Ts'o; +Cc: linux-ext4, Namjae Jeon, Ashish Sangwan

2014-04-08 1:25 GMT+09:00, Theodore Ts'o <tytso@mit.edu>:
> On Mon, Apr 07, 2014 at 11:41:15PM +0900, Namjae Jeon wrote:
>> From: Namjae Jeon <namjae.jeon@samsung.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.
>
> Hi Namjae,
>
> Thanks for working for this!
>
> Could you include in your commit description of why adding a call to
> ext4_force_commit() is necessary to avoid the problem, and what wa
> going wrong in the data=journal case?
Hi Ted.
Yes Sure. I will post the patch with detail description again.
Thanks!
>
> Thanks,
>
> 					- Ted
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-04-07 23:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-07 14:41 [PATCH] ext4: fix shared/002 and 004 fail issue in xfstests Namjae Jeon
2014-04-07 16:25 ` Theodore Ts'o
2014-04-07 23:12   ` Namjae Jeon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).