qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>,
	qemu-devel@nongnu.org, qemu-block@nongnu.org
Cc: fam@euphon.net, kwolf@redhat.com, vsementsov@virtuozzo.com,
	mreitz@redhat.com, stefanha@redhat.com, den@openvz.org
Subject: Re: [Qemu-devel] [PATCH] block/io.c: fix for the allocation failure
Date: Sat, 17 Aug 2019 09:49:38 -0500	[thread overview]
Message-ID: <fa4f4405-5a51-c7ec-f712-95e40ef6dd41@redhat.com> (raw)
In-Reply-To: <1677e835-39a1-4af3-8f4f-e1600021a2ee@redhat.com>


[-- Attachment #1.1: Type: text/plain, Size: 1949 bytes --]

On 8/17/19 9:42 AM, Eric Blake wrote:
> On 4/5/19 9:24 AM, Andrey Shinkevich wrote:
>> On a file system used by the customer, fallocate() returns an error
> 
> Which error?

Okay, I read the rest of the thread; EINVAL.  But the commit message was
not amended before becoming commit 118f9944.


>>  
>> -        if (ret == -ENOTSUP && !(flags & BDRV_REQ_NO_FALLBACK)) {
>> +        if (ret < 0 && !(flags & BDRV_REQ_NO_FALLBACK)) {
> 
> This change is a regression of sorts.  Now, you are unconditionally
> attempting the fallback for ALL failures (such as EIO) and for all
> drivers, even when that was not previously attempted and increases the
> traffic.  I think we should revert this patch and instead fix the
> fallocate() path to convert whatever ACTUAL errno you got from unaligned
> fallocate failure into ENOTSUP (that is, just the file-posix.c location
> that failed), while leaving all other errors as immediately fatal.

And the rest of the thread worried about that exact scenario.

Here's how I encountered it. I was trying to debug the nbdkit sh plugin,
with:

$ cat >script  <<\EOF
case $1 in
get_size) echo 1m;;
pread) false;;
can_write|can_zero) ;;
pwrite) ;;
zero) echo ENOTSUP; exit 1 ;;
*) exit 2;;
esac
EOF

(the script has a subtle bug; zero) should be using 'echo ENOTSUP >&2',
but because it didn't, nbdkit treats the failure as EIO rather than the
intended ENOTSUP)

coupled with:

$ qemu-io -f raw nbd://localhost:10810 -c 'w -z 0 1'

but when the script fails with EIO and qemu-io reported that the write
was still successful, I was confused (I was debugging a server-side
fallback to write, not a client-side one), until I discovered that we
changed the semantics in qemu 4.1 that EIO is no longer fatal and
attempts the write fallback.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2019-08-17 14:50 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-05 14:24 [Qemu-devel] [PATCH] block/io.c: fix for the allocation failure Andrey Shinkevich
2019-04-05 14:24 ` Andrey Shinkevich
2019-04-05 22:50 ` [Qemu-devel] [Qemu-block] " John Snow
2019-04-05 22:50   ` John Snow
2019-04-08  9:44   ` Andrey Shinkevich
2019-04-08  9:44     ` Andrey Shinkevich
2019-04-08 10:04     ` Kevin Wolf
2019-04-08 10:04       ` Kevin Wolf
2019-04-08 10:14       ` Kevin Wolf
2019-04-08 10:14         ` Kevin Wolf
2019-04-10 14:54         ` Stefan Hajnoczi
2019-04-10 14:54           ` Stefan Hajnoczi
2019-04-08 11:55       ` Andrey Shinkevich
2019-04-08 11:55         ` Andrey Shinkevich
2019-04-08  9:00 ` [Qemu-devel] " Stefan Hajnoczi
2019-04-08  9:00   ` Stefan Hajnoczi
2019-04-08  9:45   ` Andrey Shinkevich
2019-04-08  9:45     ` Andrey Shinkevich
2019-08-17 14:42 ` Eric Blake
2019-08-17 14:49   ` Eric Blake [this message]
2019-08-17 14:56     ` Eric Blake
2019-08-19 19:46       ` Denis V. Lunev
2019-08-19 20:30         ` Eric Blake
2019-08-19 20:53           ` Denis V. Lunev
2019-08-19 21:29             ` Eric Blake

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=fa4f4405-5a51-c7ec-f712-95e40ef6dd41@redhat.com \
    --to=eblake@redhat.com \
    --cc=andrey.shinkevich@virtuozzo.com \
    --cc=den@openvz.org \
    --cc=fam@euphon.net \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=vsementsov@virtuozzo.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 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).