mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Cixi Geng <cixi.geng@linux.dev>
To: linkinjeon@kernel.org, sj1557.seo@samsung.com
Cc: yuezhang.mo@sony.com, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org, zhengxu.zhang@unisoc.com
Subject: [PATCH] exfat: fdatasync flag should be same like generic_write_sync()
Date: Fri, 13 Jun 2025 14:23:39 +0800	[thread overview]
Message-ID: <20250613062339.27763-1-cixi.geng@linux.dev> (raw)

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


             reply	other threads:[~2025-06-13  6:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-13  6:23 Cixi Geng [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250613062339.27763-1-cixi.geng@linux.dev \
    --to=cixi.geng@linux.dev \
    --cc=linkinjeon@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sj1557.seo@samsung.com \
    --cc=yuezhang.mo@sony.com \
    --cc=zhengxu.zhang@unisoc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®