linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] exfat: fdatasync flag should be same like generic_write_sync()
@ 2025-06-13  6:23 Cixi Geng
  2025-06-13 10:13 ` Yuezhang.Mo
  0 siblings, 1 reply; 6+ messages in thread
From: Cixi Geng @ 2025-06-13  6:23 UTC (permalink / raw)
  To: linkinjeon, sj1557.seo
  Cc: yuezhang.mo, linux-fsdevel, linux-kernel, zhengxu.zhang

From: Zhengxu Zhang <zhengxu.zhang@unisoc.com>

Test: androbench by default setting, use 64GB sdcard.
 the random write speed:
	without this patch 3.5MB/s
	with this patch 7MB/s

After patch "11a347fb6cef", the random write speed decreased significantly.
the .write_iter() interface had been modified, and check the differences with
generic_file_write_iter(), when calling generic_rite_sync() and
exfat_file_write_iter() to call vfs_fsync_range(), the fdatasync flag is wrong,
and make not use the fdatasync mode, and make random write speed decreased.

so make the fdatasync flag like generic_write_sync().

Fixes: 11a347fb6cef ("exfat: change to get file size from DataLength")

Signed-off-by: Zhengxu Zhang <zhengxu.zhang@unisoc.com>
---
 fs/exfat/file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/exfat/file.c b/fs/exfat/file.c
index 841a5b18e3df..01d983fa7f55 100644
--- a/fs/exfat/file.c
+++ b/fs/exfat/file.c
@@ -625,7 +625,7 @@ static ssize_t exfat_file_write_iter(struct kiocb *iocb, struct iov_iter *iter)
 
 	if (iocb_is_dsync(iocb) && iocb->ki_pos > pos) {
 		ssize_t err = vfs_fsync_range(file, pos, iocb->ki_pos - 1,
-				iocb->ki_flags & IOCB_SYNC);
+				(iocb->ki_flags & IOCB_SYNC) ? 0 : 1);
 		if (err < 0)
 			return err;
 	}
-- 
2.25.1


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

end of thread, other threads:[~2025-06-18 11:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-13  6:23 [PATCH] exfat: fdatasync flag should be same like generic_write_sync() Cixi Geng
2025-06-13 10:13 ` Yuezhang.Mo
2025-06-16  9:21   ` 答复: " 张政旭 (Zhengxu Zhang)
2025-06-17  3:31     ` Yuezhang.Mo
2025-06-17  9:53       ` 答复: " 张政旭 (Zhengxu Zhang)
2025-06-18 11:11         ` Yuezhang.Mo

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).