All of lore.kernel.org
 help / color / mirror / Atom feed
From: Keir Fraser <keir@xensource.com>
To: David Edmondson <dme@sun.com>, xen-devel@lists.xensource.com
Subject: Re: [PATCH] Require that xenstored writes to a domain complete in a single chunk
Date: Mon, 26 Feb 2007 17:20:34 +0000	[thread overview]
Message-ID: <C208C762.A2B6%keir@xensource.com> (raw)
In-Reply-To: <871wkcyjig.fsf@apfelstrudel.hh.sledj.net>

On 26/2/07 16:24, "David Edmondson" <dme@sun.com> wrote:

> If xenstored is part-way through writing a header+payload into the
> buffer shared with a guest domain when the guest domain decides to
> suspend, the buffer is corrupted, as xenstored doesn't know that it
> has a partial write to complete when the domain revives.  The domain
> is expecting proper completion of the partial header+payload and is
> disappointed.
> 
> The attached patch modifies xenstored such that it checks for
> sufficient space for header+payload before making any changes to the
> shared buffer.
> 
> It is against 3.0.4-1, but the code in unstable looks the same.

This seems dubious. There's no reason we might not have payloads bigger than
the ring size (which is only 1kB).

The right fix would be in the guest, which should already be stopping any
transactions or commands across save/restore. Does this problem occur when
xenstored sends an asynchronous watch-fired message? Probably the
packet-reading thread should be interrupted and put to sleep before
suspending.

For older guest compatibility perhaps we can take a variant of your patch
that only waits for enough space is the entire message fits in the ring in
one go. This would be 'best-effort' at compatibility while not precluding
use of larger messages in general.

 -- Keir

  reply	other threads:[~2007-02-26 17:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-26 16:24 [PATCH] Require that xenstored writes to a domain complete in a single chunk David Edmondson
2007-02-26 17:20 ` Keir Fraser [this message]
2007-02-26 17:48   ` David Edmondson
2007-02-26 18:14     ` Keir Fraser
2007-02-26 19:09       ` John Levon
2007-02-26 23:12         ` Keir Fraser

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=C208C762.A2B6%keir@xensource.com \
    --to=keir@xensource.com \
    --cc=dme@sun.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.