qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Denis V. Lunev" <den@openvz.org>
To: Eric Blake <eblake@redhat.com>,
	qemu-block@nongnu.org, qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
	Pavel Borzenkov <pborzenkov@virtuozzo.com>,
	Max Reitz <mreitz@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 1/1] block: fix return code for partial write for Linux AIO
Date: Tue, 28 Jun 2016 17:37:21 +0300	[thread overview]
Message-ID: <57728BA1.2050505@openvz.org> (raw)
In-Reply-To: <5772883F.5070901@redhat.com>

On 06/28/2016 05:22 PM, Eric Blake wrote:
> On 06/28/2016 05:21 AM, Denis V. Lunev wrote:
>> On 06/23/2016 02:37 PM, Denis V. Lunev wrote:
>>> Partial write most likely means that there is not space rather than
>>> "something wrong happens". Thus it would be more natural to return
>>> ENOSPC rather than EINVAL.
>>>
>>> The problem actually happens with NBD server, which has reported EINVAL
>>> rather then ENOSPC on the first error using its protocol, which makes
>>> report to the user wrong.
> I'm not stating that this patch is wrong, but I'm also wondering if NBD
> code needs to be patched (the NBD protocol specifically recommends
> ENOSPC rather than EINVAL on attempts to write larger than size).  In
> fact, commit 29b6c3b3 may have been that fix.
>
this patch does not patch return code in NBD layer
directly. Here the command comes normally to QCOW2
and then below to raw-posix/linux-aio.

 From the point of low level there is no error at all,
the write has partial success status. In this case
completion handler raises EINVAL and this code
is reported to the caller, i.e. to NBD and through
NBD to the client.

In terms of NBD the patch altered return code
from blk_pwrite in nbd_trip(). The same code will
be reported to all other users and thus VM will be
properly put to pause if configured on the first
failed request without reporting the error to guest.

NBD is just an example.

Den

  reply	other threads:[~2016-06-28 14:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-23 11:37 [Qemu-devel] [PATCH 1/1] block: fix return code for partial write for Linux AIO Denis V. Lunev
2016-06-28 11:21 ` Denis V. Lunev
2016-06-28 14:22   ` Eric Blake
2016-06-28 14:37     ` Denis V. Lunev [this message]
2016-06-28 11:52 ` Kevin Wolf

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=57728BA1.2050505@openvz.org \
    --to=den@openvz.org \
    --cc=eblake@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=pborzenkov@virtuozzo.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.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).