From owner-freebsd-current@FreeBSD.ORG Sat Nov 11 03:20:52 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 A80DF16A403; Sat, 11 Nov 2006 03:20:52 +0000 (UTC) (envelope-from marcus@FreeBSD.org) Received: from creme-brulee.marcuscom.com (creme-brulee.marcuscom.com [24.172.16.118]) by mx1.FreeBSD.org (Postfix) with ESMTP id C1D7743D4C; Sat, 11 Nov 2006 03:20:50 +0000 (GMT) (envelope-from marcus@FreeBSD.org) Received: from [192.168.1.4] (shumai.marcuscom.com [192.168.1.4]) by creme-brulee.marcuscom.com (8.13.8/8.13.8) with ESMTP id kAB3LOiD043735; Fri, 10 Nov 2006 22:21:24 -0500 (EST) (envelope-from marcus@FreeBSD.org) From: Joe Marcus Clarke To: Pawel Worach In-Reply-To: <455530E0.5090000@gmail.com> References: <200611021653.kA2GrRWx008044@repoman.freebsd.org> <455530E0.5090000@gmail.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-HTqeJMAPUuN+ES59bP2h" Organization: FreeBSD, Inc. Date: Fri, 10 Nov 2006 22:20:49 -0500 Message-Id: <1163215249.2826.9.camel@shumai.marcuscom.com> Mime-Version: 1.0 X-Mailer: Evolution 2.8.1.1 FreeBSD GNOME Team Port Cc: Andre Oppermann , current@FreeBSD.org Subject: Re: sendfile data corruption (was: cvs commit: src/sys/kern uipc_syscalls.c src/sys/sys libkern.h socket.h) 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:20:52 -0000 --=-HTqeJMAPUuN+ES59bP2h Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Sat, 2006-11-11 at 03:09 +0100, Pawel Worach wrote: > Andre Oppermann wrote: > > andre 2006-11-02 16:53:26 UTC > >=20 > > FreeBSD src repository > >=20 > ... > > Rewrite kern_sendfile() to work in two loops, the inner which turns a= s many > ... > > =20 > > 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 >=20 > Hi Andre, >=20 > I'm seeing some strange data corruption with this change. > Using apache 2.0.59 from ports, hardware is SMP i386. >=20 > 0>root@cookie /usr/local/www/data# md5 sh > MD5 (sh) =3D 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) =3D 1b6b9786ce7aa74b7ecbc7ee82c230dd >=20 > 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) =3D 1b6b9786ce7aa74b7ecbc7ee82c230dd >=20 > Checking with hd(1) the changed data always seems to start at offset=20 > 0x0000e000. >=20 > cvs up -D '2006/11/02 17:00:00' OK > Repository revision: 1.239=20 > /export/ctm/cvs/src/sys/kern/uipc_syscalls.c,v >=20 > cvs up -D '2006/11/02 18:00:00' BROKEN > Repository revision: 1.240=20 > /export/ctm/cvs/src/sys/kern/uipc_syscalls.c,v >=20 > Files changed with update: > P geom/journal/g_journal.c > P kern/uipc_syscalls.c > P sys/libkern.h > P sys/socket.h >=20 > 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 Joe --=20 Joe Marcus Clarke FreeBSD GNOME Team :: gnome@FreeBSD.org FreeNode / #freebsd-gnome http://www.FreeBSD.org/gnome --=-HTqeJMAPUuN+ES59bP2h Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (FreeBSD) iD8DBQBFVUGRb2iPiv4Uz4cRAhNTAKCIo9rQXxih5Yr2qsjwEV1aBPIEGACfbZqL z2aseuZiyU3fU3Sq4aMnIIA= =tV9Q -----END PGP SIGNATURE----- --=-HTqeJMAPUuN+ES59bP2h--