From: Jason Dillaman Date: Wed, 2 Dec 2020 19:03:42 +0000 (-0500) Subject: engines/rbd: issue initial flush to enable writeback/around mode X-Git-Tag: fio-3.26~77^2 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=8e4e151fe1f7e2548c4de268e085634696db4cb1;p=fio.git engines/rbd: issue initial flush to enable writeback/around mode By default librbd will use a writethrough cache until it receives the first flush. Send a no-op flush after opening the image to ensure writearound (default) or writeback cache modes can be properly enabled (unlesss direct=1). Signed-off-by: Jason Dillaman --- diff --git a/engines/rbd.c b/engines/rbd.c index 336837e9..c6203d4c 100644 --- a/engines/rbd.c +++ b/engines/rbd.c @@ -240,6 +240,17 @@ static int _fio_rbd_connect(struct thread_data *td) goto failed_open; } + if (!td->o.odirect) { + /* + * ensure cache enables writeback/around mode unless explicitly + * configured for writethrough mode + */ + r = rbd_flush(rbd->image); + if (r < 0) { + log_info("rbd: failed to issue initial flush\n"); + } + } + if (!_fio_rbd_setup_poll(rbd)) goto failed_poll;