Skip to contentSkip to conversation

ext4:fix different behavior of fsync when use fast commit

PATCH Superseded Xin Yin 1 participant 1 message Nov 15, 2021 ext4 file system

lore
Share & tools
lore

Xin Yin

author
#0 lore raw

PATCH 1/1 ext4:fix different behavior of fsync when use fast commit

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

---
 fs/ext4/fast_commit.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ext4/fast_commit.c +1 -1
index 8ea5a81e6554..2fc573575ebc 100644
@@ -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);
 }
 
Signature · 1 line
2.20.1