From nobody@FreeBSD.org  Thu Nov  4 07:33:48 2004
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 8E7C816A4CE
	for <freebsd-gnats-submit@FreeBSD.org>; Thu,  4 Nov 2004 07:33:48 +0000 (GMT)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 817CF43D46
	for <freebsd-gnats-submit@FreeBSD.org>; Thu,  4 Nov 2004 07:33:48 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.12.11/8.12.11) with ESMTP id iA47XlL9033849
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 4 Nov 2004 07:33:47 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.12.11/8.12.11/Submit) id iA47Xlql033847;
	Thu, 4 Nov 2004 07:33:47 GMT
	(envelope-from nobody)
Message-Id: <200411040733.iA47Xlql033847@www.freebsd.org>
Date: Thu, 4 Nov 2004 07:33:47 GMT
From: Kazuo Dohzono <dohzono@hf.rim.or.jp>
To: freebsd-gnats-submit@FreeBSD.org
Subject: mount_ntfs: can't access to a large file (over 4G?)
X-Send-Pr-Version: www-2.3

>Number:         73514
>Category:       kern
>Synopsis:       [ntfs] [patch] mount_ntfs: can't access to a large file (over 4G?)
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    le
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Nov 04 07:40:23 GMT 2004
>Closed-Date:    Wed Jul 25 15:55:59 GMT 2007
>Last-Modified:  Wed Jul 25 15:55:59 GMT 2007
>Originator:     Kazuo Dohzono
>Release:        5.2.1-RELEASE-p9
>Organization:
>Environment:
FreeBSD abacus 5.2.1-RELEASE-p9 FreeBSD 5.2.1-RELEASE-p9 #1: Tue Jul 27 15:41:38 JST 2004     dohzono@abacus:/usr/obj/usr/src/sys/GENERIC  i386
>Description:
      Applications can not access to the latter part of large file (over 4G) when it is mounted with mount_ntfs. 
>How-To-Repeat:
      Prepare an ISO file which contains a movie (over 6G). Put it onto a ntfs (created by WindowsXP) and mount it with mount_ntfs. "Mplayer -dvd-device /$MNT/movie.ISO dvd://1" should play whole of the movie, but it stops about 2/3 of the movie. 

      This is not a mplayer's problem because mplayer can play the same file when it is on the network (and mounted with mount_smbfs). 

>Fix:
      
>Release-Note:
>Audit-Trail:

From: dmitry@atlantis.dp.ua
To: freebsd-gnats-submit@FreeBSD.org, dohzono@hf.rim.or.jp
Cc:  
Subject: [PATCH] Re: kern/73514: mount_ntfs: can't access large file
Date: Thu, 3 Mar 2005 15:57:31 +0200 (EET)

 Hello!
 
   I've reviewed ntfs code and found that it isn't 64-bit clean (it uses
 32-bit data and 32-bit min()/max() comparisons instead of 64-bit ones).
 So I've tried to repair it. Look at results at
 
 ftp://external.atlantis.dp.ua/FreeBSD/ntfs-64/ntfs-5.01.patch
 
 (patch against 5.3-RELEASE and 5-STABLE) or
 
 ftp://external.atlantis.dp.ua/FreeBSD/ntfs-64/ntfs-6.01.patch
 
 (patch against HEAD). I verified this patch under 5.3-RELEASE - now sequential
 read of long (4.9Gb and 6Gb) files works correctly: I can play them using
 mplayer and verify MD5-sum using gmd5sum. However, mmap() doesn't work
 correctly and even crashes system after my patch. Before patch,
 the following command:
 
 cmp file.avi file.avi 0x100000000 0x100000000
 
 against file on NTFS causes the following diagnostics:
 
 Feb 25 20:42:53 homelynx kernel: ntfs_strategy: ntfs_readattr failed
 Feb 25 20:42:53 homelynx kernel: vnode_pager_getpages: I/O read error
 Feb 25 20:42:53 homelynx kernel: vm_fault: pager read error, pid 2774 (cmp)
 
 With my patch, I'm getting the following panic (hand-transcribed):
 
 panic: vnode_pager_getpages: unexpected missing page: firstaddr: -1,
     foff: 0x080000000, vnp_size: 0x1127ba3e00
 
 I'm asking for the help of people who know mmap()-related stuff well.
 I can't find this remaining bug myself.
 
 Sincerely, Dmitry
 --
 Atlantis ISP, System Administrator
 e-mail:  dmitry@atlantis.dp.ua
 nic-hdl: LYNX-RIPE
 
State-Changed-From-To: open->closed 
State-Changed-By: le 
State-Changed-When: Mon Nov 20 19:31:07 UTC 2006 
State-Changed-Why:  
Unfortunately, your patch isn't available anymore, but 
I've just committed a fix to -CURRENT for this 4GB-problem. 


Responsible-Changed-From-To: freebsd-bugs->le 
Responsible-Changed-By: le 
Responsible-Changed-When: Mon Nov 20 19:31:07 UTC 2006 
Responsible-Changed-Why:  
Unfortunately, your patch isn't available anymore, but 
I've just committed a fix to -CURRENT for this 4GB-problem. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=73514 
State-Changed-From-To: closed->patched 
State-Changed-By: le 
State-Changed-When: Sun Nov 26 19:25:07 UTC 2006 
State-Changed-Why:  
As suggested by rodrigc, re-open this PR and put it into 
'patched' state, as a reminder for merging the fix later. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=73514 
State-Changed-From-To: patched->closed 
State-Changed-By: pav 
State-Changed-When: Wed Jul 25 15:55:49 UTC 2007 
State-Changed-Why:  
Merged to 6-STABLE. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=73514 
>Unformatted:
