All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RESEND] ext4:fix different behavior of fsync when use fast commit
@ 2021-12-24  6:57 Xin Yin
  2022-01-06  3:22 ` Theodore Ts'o
  0 siblings, 1 reply; 3+ messages in thread
From: Xin Yin @ 2021-12-24  6:57 UTC (permalink / raw)
  To: harshadshirwadkar, tytso, adilger.kernel
  Cc: linux-ext4, linux-kernel, Xin Yin

For the follow test example:
-mkdir test/
-create&write test/a.txt
-fsync test/a.txt
-crash (before a full commit)

If fast commit is used then "a.txt" will lost, while the normal
journaling can recover it.

We should keep behavior of fsync unchanged when use fast commit.

other report: https://www.spinics.net/lists/linux-ext4/msg80514.html

Signed-off-by: Xin Yin <yinxin.x@bytedance.com>
---
 fs/ext4/fast_commit.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/ext4/fast_commit.c b/fs/ext4/fast_commit.c
index 3deb97b22ca4..4b843648ffe5 100644
--- a/fs/ext4/fast_commit.c
+++ b/fs/ext4/fast_commit.c
@@ -423,7 +423,7 @@ void __ext4_fc_track_create(handle_t *handle, struct inode *inode,
 	args.op = EXT4_FC_TAG_CREAT;
 
 	ret = ext4_fc_track_template(handle, inode, __track_dentry_update,
-					(void *)&args, 0);
+					(void *)&args, 1);
 	trace_ext4_fc_track_create(inode, dentry, ret);
 }
 
-- 
2.20.1


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

end of thread, other threads:[~2022-01-07  8:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-24  6:57 [PATCH RESEND] ext4:fix different behavior of fsync when use fast commit Xin Yin
2022-01-06  3:22 ` Theodore Ts'o
2022-01-07  8:49   ` [External] " Xin Yin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.