From owner-freebsd-bugs@FreeBSD.ORG Mon Dec 5 21:51:22 2005 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4BA0716A41F for ; Mon, 5 Dec 2005 21:51:22 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id DFC3F43DC0 for ; Mon, 5 Dec 2005 21:50:16 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id jB5Lo4ZU025762 for ; Mon, 5 Dec 2005 21:50:04 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id jB5Lo4LS025761; Mon, 5 Dec 2005 21:50:04 GMT (envelope-from gnats) Date: Mon, 5 Dec 2005 21:50:04 GMT Message-Id: <200512052150.jB5Lo4LS025761@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: David Kelly Cc: Subject: Re: bin/89100: premature EOF with ftpd on some large files X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: David Kelly List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Dec 2005 21:51:22 -0000 The following reply was made to PR bin/89100; it has been noted by GNATS. From: David Kelly To: Deomid Ryabkov Cc: bug-followup@FreeBSD.org Subject: Re: bin/89100: premature EOF with ftpd on some large files Date: Mon, 5 Dec 2005 15:39:36 -0600 On Mon, Dec 05, 2005 at 11:44:05PM +0300, Deomid Ryabkov wrote: > i have similar problem: sendfile(2) returns prematurely, > when exactly 2^32 bytes left to transfer. > this is demonstrated by ftpd (which uses sendfile), but applies to > apache too (if configured with enablesendfile yes). > in my case, sendfile misbehaves only when asked to send file residing on > NFS-mounted filesystem. > this seems to happen to all files > 4G resiging on NFS-mounted > filesystems. those same files can be read without problem with read(2), > therefore copying with cp(1) succeeds. What I find is that the files "break" somehow for sendfile() once they have aged a bit on the filesystem. "cp -p" the problem file to the same filesystem and sendfile() (via ftpd) sends the copied file correctly today but won't a day or two later. Guess I should try a reboot after copy to see if that breaks the file. Its as if sendfile() doesn't know that it has not finished its job. Possibly a fresh copy has metadata cached by the kernel but sendfile() quits rather than fetch needed metadata if its missing. Of course this worked in RELENG_5. -- David Kelly N4HHE, dkelly@HiWAAY.net ======================================================================== Whom computers would destroy, they must first drive mad.