Received: from eggs.gnu.org ([2001:4830:134:3::10]:35652) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XopHv-0001E6-1d for qemu-devel@nongnu.org; Thu, 13 Nov 2014 02:57:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XopHq-0001Rp-3s for qemu-devel@nongnu.org; Thu, 13 Nov 2014 02:57:54 -0500 Received: from mx1.redhat.com ([209.132.183.28]:57445) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XopHp-0001Rl-Sz for qemu-devel@nongnu.org; Thu, 13 Nov 2014 02:57:50 -0500 From: Markus Armbruster References: <5463C29F.90700@redhat.com> Date: Thu, 13 Nov 2014 08:57:41 +0100 In-Reply-To: <5463C29F.90700@redhat.com> (Eric Blake's message of "Wed, 12 Nov 2014 13:27:11 -0700") Message-ID: <8761ejo7m2.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH 1/1] block migration: fix return value mismatch List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: Gary Hook , "qemu-devel@nongnu.org" Eric Blake writes: > On 11/12/2014 11:48 AM, Gary Hook wrote: >> The function uses a ternary return value (<, >, == 0) defined as an >> int. The code in in this function uses int64_t types to collect >> ftell() return values and use their difference as the return >> value. Unfortunately, narrowing of integer types results in the >> disposal of the left-most bits that won't fit in the target >> type. Here, for values larger than 2GB, the resulting value will be >> randomly negative or positive, based on total number of blocks. The >> patch ensures that only +1, -1, or 0 are returned to properly report >> status. >> > > Please wrap commit messages at around 70 characters ('git log' likes to > indent, and people still like to use 80-column windows to read 'git log'). The true reason for limiting commit message width is not humoring curmudgeons insisting on antiquated terminal widths, it's us antiquated human beings: we tend to have trouble following long lines with our eyes (I sure do). Typographic manuals suggest to limit columns to roughly 60 characters for exactly that reason[*]. 70 is already a compromise between legibility and "writability". [...] [*] https://en.wikipedia.org/wiki/Column_(typography)#Typographic_style