lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 26 Jan 2023 14:16:57 +0900
From:   Huijin Park <huijin.park@...sung.com>
To:     Jens Axboe <axboe@...nel.dk>, Christoph Hellwig <hch@....de>,
        Chaitanya Kulkarni <kch@...dia.com>
Cc:     Ming Lei <ming.lei@...onical.com>, linux-block@...r.kernel.org,
        linux-kernel@...r.kernel.org, huijin.park@...sung.com,
        bbanghj.park@...il.com
Subject: [PATCH] loop: change fsync to fdatasync when update dio

In general, fsync has a larger overhead than fdatasync. And since the
dio option is for data, it seems like fdatasync is enough.
So this patch changes it to fdatasync which has little load relatively.

Signed-off-by: Huijin Park <huijin.park@...sung.com>

diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index 1518a6423279..6c7ce8be8c0c 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -203,7 +203,7 @@ static void __loop_update_dio(struct loop_device *lo, bool dio)
 		return;
 
 	/* flush dirty pages before changing direct IO */
-	vfs_fsync(file, 0);
+	vfs_fsync(file, 1);
 
 	/*
 	 * The flag of LO_FLAGS_DIRECT_IO is handled similarly with
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ