xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: David Scott <dave@recoil.org>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>,
	Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Wei Liu <wei.liu2@citrix.com>,
	Ian Campbell <ian.campbell@citrix.com>,
	Xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH] oxenstored: fix short-write issue
Date: Wed, 28 Oct 2015 14:00:02 +0000	[thread overview]
Message-ID: <5630D4E2.8070201@citrix.com> (raw)
In-Reply-To: <C2D53C7F-0667-470E-A61B-22333D89E816@recoil.org>

On 28/10/15 13:34, David Scott wrote:
>
>> On 27 Oct 2015, at 17:31, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
>>
>> On 27/10/15 17:28, Samuel Thibault wrote:
>>> Andrew Cooper, le Tue 27 Oct 2015 17:21:39 +0000, a écrit :
>>>> as the second attempted write could return short as well.
>>> That is fine. The second attempt will only return a short write if there
>>> was really not enough room for it, which is what we want.
>> Then surely the bug is that Xs_ring.write returns short when it shouldn’t?
>
>> On 27 Oct 2015, at 17:31, Samuel Thibault <samuel.thibault@ens-lyon.org> wrote:
>>
>> Another way would be to make ml_interface_write write both pieces
>> instead of just a contiguous one.  The caml code would then look less
>> suspicious :)
>>
> I agree with both Andrew and Samuel that it would be a better fix if Xs_ring.write (== “ml_interface_write”) wrote both pieces at once.
>
> However I believe the ‘suspicious’ OCaml patch fixes the specific issue (— or have I missed something?).

Actually the suspicious OCaml is still buggy in the case that there was
a genuine short write followed by a false short write from wrapping the
ring.

>
> Last time I meddled with the C-level ring reading/writing code I didn’t get it quite right. Does anyone have time to prototype what a C-level fix would look like? If we’re short of time I could live with the OCaml-level fix, especially since Wei has done some stress-testing (assuming everyone believes it fixes the issue)

There are several bugs in that function (the remaining size calculations
are plain wrong), and Samuels patch sadly doesn't address all of them. 

I will throw a different patch together addressing all the issues I can
spot.

~Andrew

  parent reply	other threads:[~2015-10-28 14:00 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-27 17:10 [PATCH] oxenstored: fix short-write issue Wei Liu
2015-10-27 17:21 ` Samuel Thibault
2015-10-27 17:21 ` Andrew Cooper
2015-10-27 17:26   ` Samuel Thibault
2015-10-27 17:28   ` Samuel Thibault
2015-10-27 17:31     ` Samuel Thibault
2015-10-27 17:31     ` Andrew Cooper
2015-10-28 13:34       ` David Scott
2015-10-28 13:47         ` Samuel Thibault
2015-10-28 14:00         ` Andrew Cooper [this message]
2015-10-28 14:04 ` David Vrabel
2015-11-02 13:44 ` Ian Campbell
2015-11-02 14:10   ` Andrew Cooper
2015-11-02 14:24     ` Ian Campbell
2015-11-02 14:27       ` Andrew Cooper

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=5630D4E2.8070201@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=dave@recoil.org \
    --cc=ian.campbell@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=samuel.thibault@ens-lyon.org \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).