From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dave Kleikamp Subject: Re: stat64 for over 2TB file returned invalid st_blocks Date: Fri, 02 Dec 2005 08:11:50 -0600 Message-ID: <1133532710.8890.11.camel@kleikamp.austin.ibm.com> References: <01e901c5f66e$d4551b70$4168010a@bsd.tnes.nec.co.jp> <1133447539.8557.14.camel@kleikamp.austin.ibm.com> <041701c5f742$d6b0a450$4168010a@bsd.tnes.nec.co.jp> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Return-path: Received: from e34.co.us.ibm.com ([32.97.110.152]:49820 "EHLO e34.co.us.ibm.com") by vger.kernel.org with ESMTP id S1750754AbVLBOL5 (ORCPT ); Fri, 2 Dec 2005 09:11:57 -0500 To: Takashi Sato In-Reply-To: <041701c5f742$d6b0a450$4168010a@bsd.tnes.nec.co.jp> Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Fri, 2005-12-02 at 22:18 +0900, Takashi Sato wrote: > >> 2. Change the type of architecture dependent stat64.st_blocks in > >> include/asm/asm-*/stat.h from unsigned long to unsigned long lo= ng. > >> I tried modifying only stat64 of 32bit architecture > >> (include/asm-i386/stat.h). > > > >This changes the API, but the structure does suggest that the 4-byte= pad > >should be used for the high-order bytes of st_blocks, so that's not > >really a problem. A correct fix would replace __pad4 with > >st_blocks_high (or something like that) and ensure that the high-ord= er > >word was stored there. Your proposed fix would only be correct on > >little-endian hardware, as J=F6rn pointed out. >=20 > Thank you for your advice. I'll research for glibc and consider > how to implement. > By the way I think, as Avi Kivity said, it's always little-endian on = i386, > is it correct? That's true. The patch does fix i386 without any bad side-effects. A generic fix that would fix all architectures would be a little more complicated, since the size of st_blocks varies. 32-bit big-endian would have to explicitly copy the high and low words. (The first time = I looked at this, I ignored the fact that the change was in asm-i386.) Shaggy --=20 David Kleikamp IBM Linux Technology Center - To unsubscribe from this list: send the line "unsubscribe linux-fsdevel= " in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html