From owner-freebsd-stable@FreeBSD.ORG Mon Jul 7 12:43:35 2008 Return-Path: Delivered-To: stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C3F71065676 for ; Mon, 7 Jul 2008 12:43:35 +0000 (UTC) (envelope-from gaijin.k@gmail.com) Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.177]) by mx1.freebsd.org (Postfix) with ESMTP id EEA618FC13 for ; Mon, 7 Jul 2008 12:43:34 +0000 (UTC) (envelope-from gaijin.k@gmail.com) Received: by wa-out-1112.google.com with SMTP id j4so1262636wah.3 for ; Mon, 07 Jul 2008 05:43:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:from:to:cc :in-reply-to:references:content-type:date:message-id:mime-version :x-mailer:content-transfer-encoding; bh=zgkc1BoGkK9YBHuIVMSmO8uCLv2qxafUr+F6qW2uwoY=; b=naKlEO3vNvEtUKV63mehfwGLwMYBv+e5WZ+wRg0avjYG34pU4qaqPTAJpK5gx+VYnp babGLY8bBiuW0InlOXaNWcHNAubkEQxdD29WgXbsciJko/Q6KCqbetcgPnQQf9OhNUd3 2hcMOuqFgOJ+HQhYM1qSJ1cdoPHl7v8EUBNWw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:cc:in-reply-to:references:content-type:date :message-id:mime-version:x-mailer:content-transfer-encoding; b=bAthx8LuBNhRzhtIEdn9Ykifbcp0kXdhzyuJxtYiEVqSVA8xAZyHonhdjbEHwSwg9H VZKtzYuuQ39bm0kPN+qvs0jqjQYCdeCL8iSzJ2miH34VDXtP4B4UUeNkhTLqjpy4J6vT 6ZlaDypOcNq4vOQT5ufLAYJgGPFcEeuvi9dN4= Received: by 10.114.56.4 with SMTP id e4mr6247731waa.0.1215434614348; Mon, 07 Jul 2008 05:43:34 -0700 (PDT) Received: from ?10.0.3.231? ( [70.111.175.14]) by mx.google.com with ESMTPS id 34sm5065637yxm.0.2008.07.07.05.43.32 (version=SSLv3 cipher=RC4-MD5); Mon, 07 Jul 2008 05:43:33 -0700 (PDT) From: "Alexandre \"Sunny\" Kovalenko" To: Jilles Tjoelker In-Reply-To: <20080706111511.GA68941@stack.nl> References: <1214770585.1079.13.camel@RabbitsDen> <20080706111511.GA68941@stack.nl> Content-Type: text/plain; charset=utf-8 Date: Mon, 07 Jul 2008 08:43:27 -0400 Message-Id: <1215434607.1035.1.camel@RabbitsDen> Mime-Version: 1.0 X-Mailer: Evolution 2.22.3.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 8bit Cc: stable@freebsd.org Subject: Re: expand_number(3) silently truncates numeric part of the argument to 32 bit on i386, light impact on gjournal X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jul 2008 12:43:35 -0000 On Sun, 2008-07-06 at 13:15 +0200, Jilles Tjoelker wrote: > On Sun, Jun 29, 2008 at 04:16:25PM -0400, Alexandre Sunny Kovalenko wrote: > > I honestly don't know whether it should or should not do it, and if it > > should not, what errno should be set to. Program below gives following > > output on RELENG_7 as of June 28th: > > > sunny:RabbitsDen>./expand_number 5368709120k > > Result is 1099511627776 > > sunny:RabbitsDen>./expand_number 5120G > > Result is 5497558138880 > > sunny:RabbitsDen> > > > One of the more interesting manifestations in the userland is that > > > gjournal label -s 5368709120 -f /dev/da0s1a > > > quietly gives you 1G of the journal in the resulting file system. > > [snip program calling expand_number(3)] > > This happens because src/lib/libutil/expand_number.c does not include > the necessary header for calling strtoimax(3). The file is > compiled without compiler warnings, so the bug shows up as wrong > behaviour. > > Adding #include fixes it. > > The file is slightly changed in CURRENT but the same patch should apply. This worked beautifully on RELENG_7. Will you be commiting this or do I need to open a PR? Thank you. -- Alexandre "Sunny" Kovalenko (Олександр Коваленко)