Skip to content

Commit 2f2d42a

Browse files
Zhengxu Zhangnamjaejeon
authored andcommitted
exfat: fdatasync flag should be same like generic_write_sync()
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_write_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 use generic_write_sync() instead of vfs_fsync_range(). Fixes: 11a347f ("exfat: change to get file size from DataLength") Signed-off-by: Zhengxu Zhang <zhengxu.zhang@unisoc.com> Acked-by: Yuezhang Mo <Yuezhang.Mo@sony.com> Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
1 parent cbbf0a7 commit 2f2d42a

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

fs/exfat/file.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -622,9 +622,8 @@ static ssize_t exfat_file_write_iter(struct kiocb *iocb, struct iov_iter *iter)
622622
if (pos > valid_size)
623623
pos = valid_size;
624624

625-
if (iocb_is_dsync(iocb) && iocb->ki_pos > pos) {
626-
ssize_t err = vfs_fsync_range(file, pos, iocb->ki_pos - 1,
627-
iocb->ki_flags & IOCB_SYNC);
625+
if (iocb->ki_pos > pos) {
626+
ssize_t err = generic_write_sync(iocb, iocb->ki_pos - pos);
628627
if (err < 0)
629628
return err;
630629
}

0 commit comments

Comments
 (0)