From: Eric Blake <eblake@redhat.com>
To: "Richard W.M. Jones" <rjones@redhat.com>,
Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Cc: fam@euphon.net, kwolf@redhat.com, berto@igalia.com,
qemu-block@nongnu.org, qemu-devel@nongnu.org, mreitz@redhat.com,
stefanha@redhat.com, den@openvz.org, berrange@redhat.com
Subject: Re: [PATCH 4/4] block: introduce BDRV_MAX_LENGTH
Date: Thu, 4 Feb 2021 08:05:13 -0600 [thread overview]
Message-ID: <61dbae79-7643-5464-7be8-3c067bd5527a@redhat.com> (raw)
In-Reply-To: <20210107122005.GC2673@redhat.com>
On 1/7/21 6:20 AM, Richard W.M. Jones wrote:
>> Actually that's not the only problem. It appears that we're unable to
>> read or write the last sector of this disk:
>>
>> $ nbdkit memory $(( 2**63 - 2**30 )) --run 'build/qemu-io -r -f raw "$uri" -c "r -v $(( 2**63 - 2**30 - 512 )) 512" '
>> read failed: Input/output error
>>
>> $ nbdkit memory $(( 2**63 - 2**30 )) --run 'build/qemu-io -f raw "$uri" -c "w -P 3 $(( 2**63 - 2**30 - 512 )) 512" '
>> write failed: Input/output error
>>
>> You can play around with the constants. I found it's possible to read
>> and write the non-aligned 512 bytes starting at 2^63-2^30-513. Could
>> be a fencepost error somewhere in qemu?
>
> Actually this is a pre-existing bug in qemu.
>
> What happens is qemu-io calls qemu_strtosz("9223372035781033472")
> which returns 0x7fffffffc0000000 and no error. That answer is plain
> flat out wrong. The reason for that is qemu_strtosz uses floating
> point for the calculation(!) so is limited to 53 bits of precision and
> silently truncates.
I'm working a patch for that soon. It was easy to fix things to parse
with full 64 bits of precision while still allowing a fractional bump
(for things like 1.5M), but harder to chase down all the spots in the
testsuite that are impacted by our parser now being more accurate.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
next prev parent reply other threads:[~2021-02-04 14:08 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-03 22:27 [PATCH 0/4] block: prepare for 64bit Vladimir Sementsov-Ogievskiy
2020-12-03 22:27 ` [PATCH 1/4] block/file-posix: fix workaround in raw_do_pwrite_zeroes() Vladimir Sementsov-Ogievskiy
2020-12-03 22:27 ` [PATCH 2/4] block/io: bdrv_refresh_limits(): use ERRP_GUARD Vladimir Sementsov-Ogievskiy
2020-12-04 15:08 ` Alberto Garcia
2020-12-03 22:27 ` [PATCH 3/4] block/io: bdrv_check_byte_request(): drop bdrv_is_inserted() Vladimir Sementsov-Ogievskiy
2020-12-04 15:16 ` Alberto Garcia
2020-12-03 22:27 ` [PATCH 4/4] block: introduce BDRV_MAX_LENGTH Vladimir Sementsov-Ogievskiy
2021-01-07 9:58 ` Richard W.M. Jones
2021-01-07 10:56 ` Richard W.M. Jones
2021-01-07 12:20 ` Richard W.M. Jones
2021-01-08 11:14 ` Vladimir Sementsov-Ogievskiy
2021-01-08 11:27 ` Daniel P. Berrangé
2021-02-04 14:05 ` Eric Blake [this message]
2021-01-08 10:51 ` Vladimir Sementsov-Ogievskiy
2021-01-08 11:02 ` Richard W.M. Jones
2020-12-08 17:13 ` [PATCH 0/4] block: prepare for 64bit Kevin Wolf
2020-12-08 17:32 ` Vladimir Sementsov-Ogievskiy
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=61dbae79-7643-5464-7be8-3c067bd5527a@redhat.com \
--to=eblake@redhat.com \
--cc=berrange@redhat.com \
--cc=berto@igalia.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=rjones@redhat.com \
--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).