+ else if (ret == -EINVAL && io_u->ddir == DDIR_SYNC) {
+ /*
+ * the async fsync doesn't currently seem to be
+ * supported, so just fsync if we fail with EINVAL
+ * for a sync. since buffered io is also sync
+ * with libaio (still), we don't have pending
+ * requests to flush first.
+ */
+ ret = fsync(io_u->file->fd);
+ ld->sync_io_u = io_u;
+ break;
+ } else