Return-Path: Delivered-To: apmail-apr-dev-archive@www.apache.org Received: (qmail 45892 invoked from network); 8 Feb 2006 09:40:14 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 8 Feb 2006 09:40:14 -0000 Received: (qmail 741 invoked by uid 500); 8 Feb 2006 09:39:53 -0000 Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 710 invoked by uid 500); 8 Feb 2006 09:39:53 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Id: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 699 invoked by uid 99); 8 Feb 2006 09:39:52 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Feb 2006 01:39:52 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of jorton@redhat.com designates 66.187.233.31 as permitted sender) Received: from [66.187.233.31] (HELO mx1.redhat.com) (66.187.233.31) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Feb 2006 01:39:52 -0800 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.11) with ESMTP id k189dUQ8017476; Wed, 8 Feb 2006 04:39:30 -0500 Received: from radish.cambridge.redhat.com (radish.cambridge.redhat.com [172.16.18.90]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id k189dU119421; Wed, 8 Feb 2006 04:39:30 -0500 Received: (from jorton@localhost) by radish.cambridge.redhat.com (8.13.4/8.13.4/Submit) id k189dSKe007006; Wed, 8 Feb 2006 09:39:28 GMT Date: Wed, 8 Feb 2006 09:39:28 +0000 From: Joe Orton To: Garrett Rooney Cc: APR Developer List Subject: Re: [PATCH] large files, seek, and unsigned longs Message-ID: <20060208093928.GB20394@redhat.com> Mail-Followup-To: Garrett Rooney , APR Developer List References: <7edfeeef0602072116p41e25c3el71000e55f12d0a14@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <7edfeeef0602072116p41e25c3el71000e55f12d0a14@mail.gmail.com> User-Agent: Mutt/1.4.2.1i X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N On Tue, Feb 07, 2006 at 09:16:41PM -0800, Garrett Rooney wrote: > So I've been tracing a Subversion bug where fsfs repositories fall > down hard when you commit enough data in one revision to result in a > revfile that's larger than 2 gigs. It turns out that the problem was > twofold. > > First, we weren't passing APR_LARGEFILE to apr_file_open, which is easy to fix. That's not necessary, and will introduce bugs for people using fsfs and APR 0.9.x - did you read the warning note in apr_file_io.h? > Second, and more worrying, seeking to the end of a really big file > results in an offset that's short of the actual length of the file. > The reason is that apr_file_t's filePtr member is an unsigned long, > and on a LFS system where apr_off_t is 64 bits that results in the > offset getting truncated. Changing filePtr to an apr_off_t fixes the > problem, and I can't see anything wrong with making that change, but > I'd love a second set of eyes on this. Nice catch, this is a file opened with APR_BUFFERED, right? That's the only time this patch should make a difference. I'll add some test cases for that combination. Regards, joe