qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] QEMU: fsync AIO writes on flush request


From: Jamie Lokier
Subject: Re: [Qemu-devel] [PATCH] QEMU: fsync AIO writes on flush request
Date: Fri, 28 Mar 2008 15:07:03 +0000
User-agent: Mutt/1.5.13 (2006-08-11)

Marcelo Tosatti wrote:
> Its necessary to guarantee that pending AIO writes have reached stable
> storage when the flush request returns.
> 
> Also change fsync() to fdatasync(), since the modification time is not
> critical data.
> +    if (aio_fsync(O_DSYNC, &acb->aiocb) < 0) {

>      BDRVRawState *s = bs->opaque;
> -    fsync(s->fd);
> +    raw_aio_flush(bs);
> +    fdatasync(s->fd);
> +
> +    /* We rely on the fact that no other AIO will be submitted
> +     * in parallel, but this should be fixed by per-device
> +     * AIO queues when allowing multiple CPU's to process IO
> +     * in QEMU.
> +     */
> +    qemu_aio_flush();

I'm a bit confused by this.  Why do you need aio_fsync(O_DSYNC) _and_
synchronous fdatasync() calls?  Aren't they equivalent?

-- Jamie




reply via email to

[Prev in Thread] Current Thread [Next in Thread]