qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Max Reitz <mreitz@redhat.com>
To: Eric Blake <eblake@redhat.com>, qemu-devel@nongnu.org
Cc: kwolf@redhat.com, chengchiwen@h3c.com, berto@igalia.com,
	tu.guoyi@h3c.com,
	"open list:Block layer core" <qemu-block@nongnu.org>,
	armbru@redhat.com, wang.yongD@h3c.com
Subject: Re: [PATCH v4] block: Fix integer promotion error in bdrv_getlength()
Date: Thu, 5 Nov 2020 17:32:35 +0100	[thread overview]
Message-ID: <3aaa7cba-58db-315c-cc75-7fc160ff7c58@redhat.com> (raw)
In-Reply-To: <20201105155122.60943-1-eblake@redhat.com>

On 05.11.20 16:51, Eric Blake wrote:
> Back in 2015, we attempted to fix error reporting for images that
> claimed to have more than INT64_MAX/512 sectors, but due to the type
> promotions caused by BDRV_SECTOR_SIZE being unsigned, this
> inadvertently forces all negative ret values to be slammed into -EFBIG
> rather than the original error.  While we're at it, we can avoid the
> confusing ?: by spelling the logic more directly.
> 
> Fixes: 4a9c9ea0d3
> Reported-by: Guoyi Tu <tu.guoyi@h3c.com>
> Signed-off-by: Eric Blake <eblake@redhat.com>
> ---
>   block.c | 9 +++++++--
>   1 file changed, 7 insertions(+), 2 deletions(-)

Thanks, applied to my block branch (replacing the original patch):

https://git.xanclic.moe/XanClic/qemu/commits/branch/block

Max



      parent reply	other threads:[~2020-11-05 16:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-05 15:51 [PATCH v4] block: Fix integer promotion error in bdrv_getlength() Eric Blake
2020-11-05 15:54 ` Alberto Garcia
2020-11-05 16:32 ` Max Reitz [this message]

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=3aaa7cba-58db-315c-cc75-7fc160ff7c58@redhat.com \
    --to=mreitz@redhat.com \
    --cc=armbru@redhat.com \
    --cc=berto@igalia.com \
    --cc=chengchiwen@h3c.com \
    --cc=eblake@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=tu.guoyi@h3c.com \
    --cc=wang.yongD@h3c.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).