From: Rik van Riel <riel@redhat.com>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] fix sector overflow for scsi disks >1TB large
Date: Tue, 27 Jan 2009 10:49:44 -0500 [thread overview]
Message-ID: <497F2D18.5010107@redhat.com> (raw)
In-Reply-To: <20090126235559.GD9296@shareable.org>
Jamie Lokier wrote:
> Rik van Riel wrote:
>> @@ -50,7 +50,7 @@
>> /* ??? We should probably keep track of whether the data trasfer is
>
> Not your fault, but I just noticed a typo: "trasfer" :-)
>
>> if (nb_sectors) {
>> nb_sectors--;
>> + /* Clip to 2TB, instead of returning capacity modulo 2TB. */
>> + if (nb_sectors > UINT_MAX)
>> + nb_sectors = UINT_MAX;
>> outbuf[0] = (nb_sectors >> 24) & 0xff;
>> outbuf[1] = (nb_sectors >> 16) & 0xff;
>> outbuf[2] = (nb_sectors >> 8) & 0xff;
>
> Wouldn't it be clearer andd safer to say 0xffffffff here, or UINT32_MAX?
>
> I know QEMU only runs on hosts with 32-bit unsigned int, and perhaps
> that will always be truea, but it's a bit unnecessary to assume it here.
Neither of your suggested changes hurts one bit, so
I'll send in a new patch :)
--
All rights reversed.
next prev parent reply other threads:[~2009-01-27 15:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-26 22:42 [Qemu-devel] [PATCH] fix sector overflow for scsi disks >1TB large Rik van Riel
2009-01-26 23:55 ` Jamie Lokier
2009-01-27 15:49 ` Rik van Riel [this message]
-- strict thread matches above, loose matches on Subject: below --
2009-01-27 15:51 Rik van Riel
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=497F2D18.5010107@redhat.com \
--to=riel@redhat.com \
--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).