From owner-freebsd-bugs@FreeBSD.ORG Tue Jan 24 04:30:10 2006 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 332AE16A41F for ; Tue, 24 Jan 2006 04:30:10 +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 A2A6643D49 for ; Tue, 24 Jan 2006 04:30:09 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k0O4U9ES085956 for ; Tue, 24 Jan 2006 04:30:09 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k0O4U9Oc085955; Tue, 24 Jan 2006 04:30:09 GMT (envelope-from gnats) Resent-Date: Tue, 24 Jan 2006 04:30:09 GMT Resent-Message-Id: <200601240430.k0O4U9Oc085955@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, David Kelly Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 00D9A16A420 for ; Tue, 24 Jan 2006 04:20:30 +0000 (GMT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [216.136.204.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7BBE643D53 for ; Tue, 24 Jan 2006 04:20:29 +0000 (GMT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.13.1/8.13.1) with ESMTP id k0O4KTGN055779 for ; Tue, 24 Jan 2006 04:20:29 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.13.1/8.13.1/Submit) id k0O4KTVU055778; Tue, 24 Jan 2006 04:20:29 GMT (envelope-from nobody) Message-Id: <200601240420.k0O4KTVU055778@www.freebsd.org> Date: Tue, 24 Jan 2006 04:20:29 GMT From: David Kelly To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-2.3 Cc: Subject: kern/92243: sendfile(2) returns early on files > 4GB X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jan 2006 04:30:10 -0000 >Number: 92243 >Category: kern >Synopsis: sendfile(2) returns early on files > 4GB >Confidential: no >Severity: serious >Priority: high >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Jan 24 04:30:08 GMT 2006 >Closed-Date: >Last-Modified: >Originator: David Kelly >Release: 6.0-STABLE >Organization: self >Environment: FreeBSD Grumpy.DynDNS.org 6.0-STABLE FreeBSD 6.0-STABLE #9: Tue Jan 17 19:25:47 CST 2006 dkelly@Grumpy.DynDNS.org:/usr5/obj/usr/src/sys/OPUS i386 >Description: This is a restatement of bin/89100 as I now believe it is a kernel problem rather than an application problem. Am now convinced it is a problem with either vm or the way sendfile(2) talks to the vm system. Sendfile(2) works correctly with a fresh large file. Files older than the last reboot (possibly filesystem umount/mount will age sufficiently) always fail. Files newer than the latest mount fail after an unknown amount of activity on that filesystem. If file size is > 4G then sendfile(2) returns to caller (wrongly) when exactly 4G is remaining. Have not experimented with 8G files. >How-To-Repeat: Get a file which is larger than 4G via ftpd, apache, or anything else which uses sendfile(2). The file must have aged a bit on the filesystem. A reboot is a sure way to age the file enough. Sendfile(2) works perfectly with a new file or fresh copy. ftp to localhost and get a big file to /dev/null to quickly reproduce the problem. >Fix: If ftpd and ftp client work well together then a "reget" will complete the truncated download. Not a fix. If enough space exists on the filesystem a fresh copy of the file will transfer correctly, yet the original still will not transfer completely. >Release-Note: >Audit-Trail: >Unformatted: