qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Max Reitz <mreitz@redhat.com>
To: Eric Blake <eblake@redhat.com>, Tuguoyi <tu.guoyi@h3c.com>,
	Kevin Wolf <kwolf@redhat.com>,
	"qemu-block@nongnu.org" <qemu-block@nongnu.org>
Cc: Chengchiwen <chengchiwen@h3c.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	Wangyong <wang.yongD@h3c.com>
Subject: Re: [PATCH] block: Fix integer promotion error in bdrv_getlength()
Date: Thu, 5 Nov 2020 14:26:51 +0100	[thread overview]
Message-ID: <f5218bd4-72f3-cf55-af2e-08e609413acf@redhat.com> (raw)
In-Reply-To: <703e17a1-544f-4e5e-a431-6e20d4a04974@redhat.com>

On 05.11.20 14:14, Eric Blake wrote:
> On 11/5/20 2:31 AM, Max Reitz wrote:
>> On 05.11.20 06:40, Tuguoyi wrote:
>>> As BDRV_SECTOR_SIZE is of type uint64_t, the expression will
>>> automatically convert the @ret to uint64_t. When an error code
>>> returned from bdrv_nb_sectors(), the promoted @ret will be a very
>>> large number, as a result the -EFBIG will be returned which is not the
>>> real error code.
>>>
>>> Signed-off-by: Guoyi Tu <tu.guoyi@h3c.com>
>>> ---
>>>    block.c | 2 +-
>>>    1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> Thanks, applied to my block branch:
>>
>> https://git.xanclic.moe/XanClic/qemu/commits/branch/block
>>
> 
> I actually preferred the v1 solution, rather than this v2, as it avoided
> a cast.

I don’t, because it doesn’t make the ?: go away, so I prefer the less 
invasive version.

If you want to send your suggested version (that drops both ?:), I’m 
happy to take that instead.

Max



  reply	other threads:[~2020-11-05 13:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-05  5:40 [PATCH] block: Fix integer promotion error in bdrv_getlength() Tuguoyi
2020-11-05  8:31 ` Max Reitz
2020-11-05 13:14   ` Eric Blake
2020-11-05 13:26     ` Max Reitz [this message]
2020-11-05 15:39       ` Eric Blake
2020-11-06  2:06     ` Tuguoyi

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=f5218bd4-72f3-cf55-af2e-08e609413acf@redhat.com \
    --to=mreitz@redhat.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).