public inbox for fio@vger.kernel.org
 help / color / mirror / Atom feed
From: Damien Le Moal <dlemoal@kernel.org>
To: fio@vger.kernel.org, Jens Axboe <axboe@kernel.dk>,
	Vincent Fu <vincentfu@gmail.com>
Subject: [PATCH v3 8/8] engines: posixaio: add support for DDIR_SYNCFS
Date: Fri, 27 Feb 2026 14:55:38 +0900	[thread overview]
Message-ID: <20260227055538.2334916-9-dlemoal@kernel.org> (raw)
In-Reply-To: <20260227055538.2334916-1-dlemoal@kernel.org>

Flag the posixaio IO engine with FIO_ASYNCIO_SYNC_SYNCFS to indicate
that it supports the syncfs operation, synchronously. Also change
fio_posixaio_queue() to execute aio_fsync() only for sync operations
that are not a syncfs, in which case, we directly call do_io_u_sync().

Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
---
 engines/posixaio.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/engines/posixaio.c b/engines/posixaio.c
index 2d0ac9fcc369..828e535157a0 100644
--- a/engines/posixaio.c
+++ b/engines/posixaio.c
@@ -142,7 +142,10 @@ static enum fio_q_status fio_posixaio_queue(struct thread_data *td,
 		return FIO_Q_COMPLETED;
 	} else {
 #ifdef CONFIG_POSIXAIO_FSYNC
-		ret = aio_fsync(O_SYNC, aiocb);
+		if (io_u->ddir != DDIR_SYNCFS)
+			ret = aio_fsync(O_SYNC, aiocb);
+		else
+			ret = 0;
 #else
 		if (pd->queued)
 			return FIO_Q_BUSY;
@@ -196,7 +199,8 @@ static int fio_posixaio_init(struct thread_data *td)
 static struct ioengine_ops ioengine = {
 	.name		= "posixaio",
 	.version	= FIO_IOOPS_VERSION,
-	.flags		= FIO_ASYNCIO_SYNC_TRIM,
+	.flags		= FIO_ASYNCIO_SYNC_TRIM |
+				FIO_ASYNCIO_SYNC_SYNCFS,
 	.init		= fio_posixaio_init,
 	.prep		= fio_posixaio_prep,
 	.queue		= fio_posixaio_queue,
-- 
2.53.0


  parent reply	other threads:[~2026-02-27  6:01 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-27  5:55 [PATCH v3 0/8] Introduce the end_syncfs option Damien Le Moal
2026-02-27  5:55 ` [PATCH v3 1/8] fio: introduce " Damien Le Moal
2026-02-27  5:55 ` [PATCH v3 2/8] engines: sync: add support for DDIR_SYNCFS Damien Le Moal
2026-02-27  5:55 ` [PATCH v3 3/8] engines: libaio: " Damien Le Moal
2026-02-27  5:55 ` [PATCH v3 4/8] engines: io_uring: " Damien Le Moal
2026-02-27  5:55 ` [PATCH v3 5/8] engines: fallocate: " Damien Le Moal
2026-02-27  5:55 ` [PATCH v3 6/8] engines: fileoperations: " Damien Le Moal
2026-02-27  5:55 ` [PATCH v3 7/8] engines: ftruncate: " Damien Le Moal
2026-02-27  5:55 ` Damien Le Moal [this message]
2026-02-27  7:11 ` [PATCH v3 0/8] Introduce the end_syncfs option fiotestbot

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=20260227055538.2334916-9-dlemoal@kernel.org \
    --to=dlemoal@kernel.org \
    --cc=axboe@kernel.dk \
    --cc=fio@vger.kernel.org \
    --cc=vincentfu@gmail.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