From owner-freebsd-bugs@FreeBSD.ORG Fri Dec 15 02:31:54 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 [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 05B8716A4CE for ; Fri, 15 Dec 2006 02:31:54 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3FD9A43D69 for ; Fri, 15 Dec 2006 02:28:57 +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 kBF2UCuB060382 for ; Fri, 15 Dec 2006 02:30:12 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id kBF2UCmg060380; Fri, 15 Dec 2006 02:30:12 GMT (envelope-from gnats) Date: Fri, 15 Dec 2006 02:30:12 GMT Message-Id: <200612150230.kBF2UCmg060380@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Axel Gonzalez Cc: Subject: Re: kern/106703: [PATCH] vn_stat() fails with files > 2Gb on msdosfs (non 386) X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Axel Gonzalez List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Dec 2006 02:31:54 -0000 The following reply was made to PR kern/106703; it has been noted by GNATS. From: Axel Gonzalez To: Tom Rhodes Cc: Remko Lodder , freebsd-gnats-submit@freebsd.org Subject: Re: kern/106703: [PATCH] vn_stat() fails with files > 2Gb on msdosfs (non 386) Date: Thu, 14 Dec 2006 20:21:16 -0600 > > One thing that crosses my mind is that (in my believing) the maximum > > size of a file under msdos(fs) was 2gb, which could explain this > > "problem" you are seeing. If that is still accurate, msdosfs_vnops.c:#define DOS_FILESIZE_MAX 0xffffffff (4294967295) = 2^32 -1 cp works ok, after patching my kernel, the file is correct (md5 match). > > Hmm, that is an interesting problem, and I'm digging the fix. > FAT32 should handle file sizes up to (2^32)-1 bytes (one byte > fewer than four gigabytes. So we should properly handle this > for all FAT32 file systems. I traced the problem down to the getulong() macro (non 386 version). Problem is not with handling of the file, clusters, dirs. Just that msdosfs_getattr() reports an incorrect (signed) size, and it makes vn_stat() fail. If it helps, more info: MAX_OFF:9223372036854775807 (max size of any file) size of the file: Correct (ufs): 3015487488 0xB3BCB000 msdosfs_getattr(): reported by w/o patch: 18446744072430071808 0xFFFFFFFEB3BCB000 (this is why it returns EOVERFLOW) reported with patch: 3015487488 0xB3BCB000