All of lore.kernel.org
 help / color / mirror / Atom feed
From: Samuel Thibault <samuel.thibault@eu.citrix.com>
To: Kouya Shimura <kouya@jp.fujitsu.com>
Cc: xen-devel@lists.xensource.com
Subject: Re: Windows Bug Check 0x101 issue
Date: Mon, 24 Mar 2008 11:01:24 +0000	[thread overview]
Message-ID: <20080324110124.GH4434@implementation.uk.xensource.com> (raw)
In-Reply-To: <7k4pawfnxs.fsf@pingu.sky.yk.fujitsu.co.jp>

Kouya Shimura, le Mon 24 Mar 2008 18:53:18 +0900, a écrit :
Content-Description: message body text
> An attached patch fixes it. However I think the root cause is
> that a timer event can't interrupt an i/o emulation.

The way qemu is designed wouldn't permit that anyway.

> How should we fix it?

We need to change the behavior of the flush operation, to make it
asynchronous, so that things can continue while the host OS is syncing,
and eventually the SCSI or IDE layer will report the completion of the
flush.

> +static void aio_fsync_cb(void *opague, int ret)
> +{
> +}
>  #endif
>  
>  static void raw_close(BlockDriverState *bs)
> @@ -602,8 +606,20 @@ static int raw_create(const char *filena
>  
>  static void raw_flush(BlockDriverState *bs)
>  {
> +#ifdef NO_AIO
>      BDRVRawState *s = bs->opaque;
>      fsync(s->fd);
> +#else
> +    RawAIOCB *acb;
> +
> +    acb = raw_aio_setup(bs, 0, NULL, 0, aio_fsync_cb, NULL);
> +    if (!acb)
> +        return;
> +    if (aio_fsync(O_SYNC, &acb->aiocb) < 0) {
> +        qemu_aio_release(acb);
> +        return;
> +    }
> +#endif
>  }

That's not correct: callers of bdrv_flush() assume that when it returns,
data _is_ on the disk.  We need to change that assumption, so that
your code becomes correct (and reports asynchronous completion from
aio_fsync_cb).

Samuel

  reply	other threads:[~2008-03-24 11:01 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-24  9:53 Windows Bug Check 0x101 issue Kouya Shimura
2008-03-24 11:01 ` Samuel Thibault [this message]
2008-03-24 11:05 ` Keir Fraser
2008-03-25 10:54   ` Kouya Shimura
2008-03-25 10:59     ` Keir Fraser
2008-03-25 11:28     ` Ian Jackson
2008-03-25 17:57       ` Samuel Thibault
2008-03-26  7:07         ` Kouya Shimura
2008-03-26 10:13           ` Samuel Thibault
2008-03-26 10:29           ` Ian Jackson
2008-03-26 10:27             ` Alan Cox
2008-03-26 10:51               ` Ian Jackson
2008-03-26 12:34                 ` Alan Cox
2008-03-26 14:18                   ` Ian Jackson
2008-03-26 10:39             ` Ian Jackson
2008-03-27  5:20             ` Kouya Shimura
2008-03-27  9:08               ` Alan Cox
2008-03-27 16:34                 ` Ian Jackson
2008-03-27 16:30                   ` Alan Cox
2008-03-27 17:39               ` Ian Jackson
2008-03-28  3:09                 ` Kouya Shimura
     [not found]                 ` <87k5jnl7qt.fsf@basil.nowhere.org>
2008-03-28  9:32                   ` Ian Jackson

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=20080324110124.GH4434@implementation.uk.xensource.com \
    --to=samuel.thibault@eu.citrix.com \
    --cc=kouya@jp.fujitsu.com \
    --cc=xen-devel@lists.xensource.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.