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 <dillaman@redhat.com>
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;