* [PATCH] ext4:fix different behavior of fsync when use fast commit
@ 2021-11-15 10:09 Xin Yin
0 siblings, 0 replies; only message in thread
From: Xin Yin @ 2021-11-15 10:09 UTC (permalink / raw)
To: tytso, adilger.kernel, harshadshirwadkar
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 8ea5a81e6554..2fc573575ebc 100644
--- a/fs/ext4/fast_commit.c
+++ b/fs/ext4/fast_commit.c
@@ -523,7 +523,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] only message in thread
only message in thread, other threads:[~2021-11-15 10:10 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-15 10:09 [PATCH] ext4:fix different behavior of fsync when use fast commit Xin Yin
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).