Return-Path: Delivered-To: apmail-apr-dev-archive@www.apache.org Received: (qmail 26604 invoked from network); 8 Feb 2006 05:17:05 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 8 Feb 2006 05:17:05 -0000 Received: (qmail 26112 invoked by uid 500); 8 Feb 2006 05:17:04 -0000 Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 26086 invoked by uid 500); 8 Feb 2006 05:17:03 -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 26073 invoked by uid 99); 8 Feb 2006 05:17:03 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Feb 2006 21:17:03 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of rooneg@gmail.com designates 64.233.184.198 as permitted sender) Received: from [64.233.184.198] (HELO wproxy.gmail.com) (64.233.184.198) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Feb 2006 21:17:02 -0800 Received: by wproxy.gmail.com with SMTP id 71so1436268wra for ; Tue, 07 Feb 2006 21:16:41 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:sender:to:subject:mime-version:content-type; b=T1gNwoiWmw4v3Yyw5qRyTG29O+TrdJyUZzcozuzr1f1mOZFqfz297zDqC7/TRx1Fw1S9zG0mwYqaPVt6+S7ya9sNVKxh6Bub94TFwfaQeEt+yj+k9p34rbxTZJmciS+C4YivOgOeCFRtACyFpgQrMEz2V7hvjNSluimUCEHznwc= Received: by 10.54.114.1 with SMTP id m1mr8921016wrc; Tue, 07 Feb 2006 21:16:41 -0800 (PST) Received: by 10.54.117.15 with HTTP; Tue, 7 Feb 2006 21:16:41 -0800 (PST) Message-ID: <7edfeeef0602072116p41e25c3el71000e55f12d0a14@mail.gmail.com> Date: Tue, 7 Feb 2006 21:16:41 -0800 From: Garrett Rooney Sender: rooneg@gmail.com To: APR Developer List Subject: [PATCH] large files, seek, and unsigned longs MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_2233_18339743.1139375801736" X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ------=_Part_2233_18339743.1139375801736 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline 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. 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.=20 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. An interesting note is that Netware and Win32 already use apr_off_t for this member, the only place other than Unix that doesn't is OS/2, so someone familiar with the OS/2 code should probably look into correcting this problem there. Anyway, here's the patch, let me know what you think. -garrett ------=_Part_2233_18339743.1139375801736 Content-Type: text/x-patch; name=fix-64bit-seeks.diff; charset=us-ascii Content-Transfer-Encoding: 7bit X-Attachment-Id: f_ejf6wsv8 Content-Disposition: attachment; filename="fix-64bit-seeks.diff" Index: include/arch/unix/apr_arch_file_io.h =================================================================== --- include/arch/unix/apr_arch_file_io.h (revision 375855) +++ include/arch/unix/apr_arch_file_io.h (working copy) @@ -107,7 +107,7 @@ apr_size_t bufsize; /* The size of the buffer */ unsigned long dataRead; /* amount of valid data read into buffer */ int direction; /* buffer being used for 0 = read, 1 = write */ - unsigned long filePtr; /* position in file of handle */ + apr_off_t filePtr; /* position in file of handle */ #if APR_HAS_THREADS struct apr_thread_mutex_t *thlock; #endif ------=_Part_2233_18339743.1139375801736--