From owner-freebsd-current@FreeBSD.ORG Sat Nov 11 03:25:41 2006 Return-Path: X-Original-To: current@freebsd.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BAF9216A416 for ; Sat, 11 Nov 2006 03:25:41 +0000 (UTC) (envelope-from pawel.worach@gmail.com) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.169]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1160043D55 for ; Sat, 11 Nov 2006 03:25:35 +0000 (GMT) (envelope-from pawel.worach@gmail.com) Received: by ug-out-1314.google.com with SMTP id o2so630175uge for ; Fri, 10 Nov 2006 19:25:35 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding; b=TbGojuOPezrw4Gv/Su4gIGjnidUkj/0il0OaY7LkQtP8TCK3Wtvx4eLV9aNS6PqleG7E7xSy4djKmmD5JnNpZTzB0YpIgkeCDtrcpp38Sb8uWHQR421JGepFFLfAnX5+SzuqMD79URwUnWd0RqHYicDn4EheRD2Z2kjTWBTKpyQ= Received: by 10.66.244.10 with SMTP id r10mr4424016ugh.1163215534748; Fri, 10 Nov 2006 19:25:34 -0800 (PST) Received: from ?192.168.1.200? ( [80.217.194.157]) by mx.google.com with ESMTP id l40sm2882642ugc.2006.11.10.19.25.33; Fri, 10 Nov 2006 19:25:34 -0800 (PST) Message-ID: <455542AB.5050203@gmail.com> Date: Sat, 11 Nov 2006 04:25:31 +0100 From: Pawel Worach User-Agent: Thunderbird 1.5.0.7 (X11/20061109) MIME-Version: 1.0 To: Joe Marcus Clarke References: <200611021653.kA2GrRWx008044@repoman.freebsd.org> <455530E0.5090000@gmail.com> <1163215249.2826.9.camel@shumai.marcuscom.com> In-Reply-To: <1163215249.2826.9.camel@shumai.marcuscom.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Andre Oppermann , current@FreeBSD.org Subject: Re: sendfile data corruption X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Nov 2006 03:25:41 -0000 Joe Marcus Clarke wrote: > On Sat, 2006-11-11 at 03:09 +0100, Pawel Worach wrote: >> Andre Oppermann wrote: >>> andre 2006-11-02 16:53:26 UTC >>> >>> FreeBSD src repository >>> >> ... >>> Rewrite kern_sendfile() to work in two loops, the inner which turns as many >> ... >>> >>> Revision Changes Path >>> 1.240 +280 -242 src/sys/kern/uipc_syscalls.c >>> 1.55 +2 -0 src/sys/sys/libkern.h >>> 1.91 +2 -1 src/sys/sys/socket.h >> Hi Andre, >> >> I'm seeing some strange data corruption with this change. >> Using apache 2.0.59 from ports, hardware is SMP i386. >> >> 0>root@cookie /usr/local/www/data# md5 sh >> MD5 (sh) = e090ae9fc697b6ec84165af920034dc4 >> 0>root@cookie /usr/local/www/data# unsetenv http_proxy >> 0>root@cookie /usr/local/www/data# fetch -o /tmp/sh http://127.0.0.1/sh >> /tmp/sh 100% of 109 kB 6516 kBps >> 0>root@cookie /usr/local/www/data# md5 /tmp/sh >> MD5 (/tmp/sh) = 1b6b9786ce7aa74b7ecbc7ee82c230dd >> >> It seems to be consistent... >> 0>root@zero /usr/local/www/data# fetch -o /tmp/sh2 http://127.0.0.1/sh >> /tmp/sh2 100% of 109 kB 41 MBps >> 0>root@zero /usr/local/www/data# md5 /tmp/sh2 >> MD5 (/tmp/sh2) = 1b6b9786ce7aa74b7ecbc7ee82c230dd >> >> Checking with hd(1) the changed data always seems to start at offset >> 0x0000e000. >> >> cvs up -D '2006/11/02 17:00:00' OK >> Repository revision: 1.239 >> /export/ctm/cvs/src/sys/kern/uipc_syscalls.c,v >> >> cvs up -D '2006/11/02 18:00:00' BROKEN >> Repository revision: 1.240 >> /export/ctm/cvs/src/sys/kern/uipc_syscalls.c,v >> >> Files changed with update: >> P geom/journal/g_journal.c >> P kern/uipc_syscalls.c >> P sys/libkern.h >> P sys/socket.h >> >> Any other information I can provide? > > Looks to me like there's some unnecessary calculations happening to get > the xfsize. Does the following patch help? > > http://www.marcuscom.com/downloads/uipc_syscalls.c.diff > Yep, this fixes the problem. Thanks! -- Pawel