From vze2ztys@verizon.net  Thu Nov 13 17:59:00 2003
Return-Path: <vze2ztys@verizon.net>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 5B7ED16A4CE
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 13 Nov 2003 17:59:00 -0800 (PST)
Received: from out001.verizon.net (out001pub.verizon.net [206.46.170.140])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 5F35243FCB
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 13 Nov 2003 17:58:59 -0800 (PST)
	(envelope-from vze2ztys@verizon.net)
Received: from outgoing.verizon.net ([192.168.1.1]) by out001.verizon.net
          (InterMail vM.5.01.05.33 201-253-122-126-133-20030313) with ESMTP
          id <20031114015858.NJHR2057.out001.verizon.net@outgoing.verizon.net>;
          Thu, 13 Nov 2003 19:58:58 -0600
Message-Id: <20031114015858.NJHR2057.out001.verizon.net@outgoing.verizon.net>
Date: Thu, 13 Nov 2003 19:58:58 -0600
From: <vze2ztys@verizon.net>
To: <FreeBSD-gnats-submit@freebsd.org>
Cc: <andrew.lankford@verizon.net>
Subject: copying from ntfs panics -CURRENT

>Number:         59271
>Category:       kern
>Synopsis:       copying from ntfs panics -CURRENT
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    tjr
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Nov 13 18:00:37 PST 2003
>Closed-Date:    Sat Nov 15 01:55:47 PST 2003
>Last-Modified:  Sat Nov 15 01:55:47 PST 2003
>Originator:     Andrew Lankford
>Release:        FreeBSD 5.1-CURRENT i386
>Organization:
none
>Environment:
System: FreeBSD bogushost2 5.1-CURRENT FreeBSD 5.1-CURRENT #3: Wed Nov 12 21:15:29 EST 2003 root@bogushost2:/usr/obj/usr/src/sys/ARL5KERNEL i386

>Description:

  copying a text file from my NTFS partition (drive C) to my /usr partition
  causes a panic.  My NTFS partition is mounted read-only.

  It might be noteworthy to mention that this partition was converted over
  to NTFS from FAT32 when I upgraded to WindowsXP.
  
  Contents of info.0:

Good dump found on device /dev/ad0s4b
  Architecture: i386
  Architecture version: 1
  Dump length: 535736320B (510 MB)
  Blocksize: 512
  Dumptime: Thu Nov 13 19:57:13 2003
  Hostname: bogushost2
  Versionstring: FreeBSD 5.1-CURRENT #3: Wed Nov 12 21:15:29 EST 2003
    root@bogushost2:/usr/obj/usr/src/sys/ARL5KERNEL
  Panicstring: filesystem goof: vop_panic[vop_specstrategy]
  Bounds: 0

  Backtrace:

(kgdb) bt
#0  doadump () at /usr/src/sys/kern/kern_shutdown.c:240
#1  0xc04cc9a0 in boot (howto=0x100) at /usr/src/sys/kern/kern_shutdown.c:372
#2  0xc04ccd88 in panic () at /usr/src/sys/kern/kern_shutdown.c:550
#3  0xc052273e in vop_panic () at /usr/src/sys/kern/vfs_default.c:171
#4  0xc0522718 in vop_defaultop (ap=0x0) at /usr/src/sys/kern/vfs_default.c:161
#5  0xc05beb1b in vnode_pager_input_smlfs (object=0xc5d1f738, m=0xc0e0cc40) at v
node_if.h:1141
#6  0xc05bf62c in vnode_pager_generic_getpages (vp=0xc5d35618, m=0xddb9d980, byt
ecount=0x1000, reqpage=0x0) at /usr/src/sys/vm/vnode_pager.c:696
#7  0xc0523309 in vop_stdgetpages (ap=0x0) at /usr/src/sys/kern/vfs_default.c:796
#8  0xc0522718 in vop_defaultop (ap=0x0) at /usr/src/sys/kern/vfs_default.c:161
#9  0xc05bf20b in vnode_pager_getpages (object=0xc5d1f738, m=0x0, count=0x0, req
page=0x0) at vnode_if.h:1317
#10 0xc05a3f02 in vm_fault (map=0xc5d230ec, vaddr=0x28060000, fault_type=0x1, fault_flags=0x0) at /usr/src/sys/vm/vm_pager.h:129
#11 0xc05f3485 in trap_pfault (frame=0xddb9da5c, usermode=0x0, eva=0x28060000) at /usr/src/sys/i386/i386/trap.c:711
#12 0xc05f30fd in trap (frame= {tf_fs = 0xc5d20018, tf_es = 0xc5630010, tf_ds = 0x28060010, tf_edi = 0xd0 812000, tf_esi = 0x28060000, tf_ebp = 0xddb9dadc, tf_isp = 0xddb9da88, tf_ebx = 0x919, tf_edx = 0x28060919, tf_ecx = 0x246, tf_eax = 0xddb9dd19, tf_trapno = 0xc , tf_err = 0x0, tf_eip = 0xc05f17a2, tf_cs = 0x8, tf_eflags = 0x10202, tf_esp = 0xddb9dc6c, tf_ss = 0xddb9dc40}) at /usr/src/sys/i386/i386/trap.c:420
#13 0xc05e43d8 in calltrap () at {standard input}:94
#14 0xc059009f in ffs_write (ap=0xddb9dbc0) at /usr/src/sys/ufs/ffs/ffs_vnops.c: 724
#15 0xc05398c2 in vn_write (fp=0xc44c6220, uio=0xddb9dc6c, active_cred=0xc4978d80, flags=0x0, td=0xc5c13c80) at vnode_if.h:432
#16 0xc04f5deb in dofilewrite (td=0xc5c13c80, fp=0xc44c6220, fd=0x0, buf=0x28060000, nbyte=0x0, offset=0x0, flags=0x0) at /usr/src/sys/sys/file.h:249
#17 0xc04f5c1e in write (td=0xc5c13c80, uap=0xddb9dd10) at /usr/src/sys/kern/sys_generic.c:331
#18 0xc05f3c90 in syscall (frame= {tf_fs = 0x2f, tf_es = 0x2f, tf_ds = 0x2f, tf_edi = 0x28060000, tf_esi = 0x919, tf_ebp = 0xbfbfe968, tf_isp = 0xddb9dd74, tf_ebx = 0x1, tf_edx = 0x4, tf_ecx = 0x8075100, tf_eax = 0x4, tf_trapno = 0xc, tf_err = 0x2, tf_eip = 0x804b077, tf_cs = 0x1f, tf_eflags = 0x213, tf_esp = 0xbfbfe91c, tf_ss = 0x2f}) at /usr/src/sys/i386/i386/trap.c:1010
#19 0xc05e442d in Xint0x80_syscall () at {standard input}:136
---Can't read userspace from dump, or kernel process---


>How-To-Repeat:

  Use cp.  I've also gotten panics when trying to execute files from the
partition via wine.  Oddly enough, I've never gotten a panic from simply
reading a file in the partition.
 
>Fix:

Wish I knew.  Let me know if there's something else I can try (provided I get
to type " sync; sync; sync; sync" before doing it :)




>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->tjr 
Responsible-Changed-By: tjr 
Responsible-Changed-When: Fri Nov 14 15:23:14 PST 2003 
Responsible-Changed-Why:  
I'll take a look at this. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=59271 

From: Tim Robbins <tjr@freebsd.org>
To: vze2ztys@verizon.net
Cc: freebsd-bugs@freebsd.org, bug-followup@freebsd.org
Subject: Re: kern/59271: copying from ntfs panics -CURRENT
Date: Sat, 15 Nov 2003 12:27:19 +1100

 Can you try this patch & let me know whether it helps? I can't reproduce the
 panic on a 4.0 GB NTFS filesystem created by Windows 2003 Server, but the code
 in question definitely looks buggy.
 
 
 --- sys/vm/vnode_pager.c.old	Sat Nov 15 12:25:45 2003
 +++ sys/vm/vnode_pager.c	Sat Nov 15 11:07:33 2003
 @@ -478,7 +478,10 @@
  
  			/* do the input */
  			bp->b_iooffset = dbtob(bp->b_blkno);
 -			VOP_SPECSTRATEGY(bp->b_vp, bp);
 +			if (dp->v_type == VCHR)
 +				VOP_SPECSTRATEGY(bp->b_vp, bp);
 +			else
 +				VOP_STRATEGY(bp->b_vp, bp);
  
  			/* we definitely need to be at splvm here */
  

From: <vze2ztys@verizon.net>
To: Tim Robbins <tjr@freebsd.org>
Cc: <freebsd-bugs@freebsd.org>, <bug-followup@freebsd.org>
Subject: Re: kern/59271: copying from ntfs panics -CURRENT
Date: Fri, 14 Nov 2003 20:56:53 -0600

 >Can you try this patch & let me know whether 
 >it helps? I can't reproduce the
 >panic on a 4.0 GB NTFS filesystem created by >Windows 2003 Server, but the code
 >in question definitely looks buggy.
 
 I recompiled the kernel with your small patch and it now looks like copying files from the partition no longer causes panics.  Thanks!! 
 
 Here's to stumbling upon more panics like this one if there are any more to be found so that 5.2-RELEASE will give me the same warm and fuzzy feeling of that 4.1.1 did.
 
 Andrew Lankford
 
State-Changed-From-To: open->closed 
State-Changed-By: tjr 
State-Changed-When: Sat Nov 15 01:54:57 PST 2003 
State-Changed-Why:  
Fixed; thanks for saving us from shipping 5.2-R with this nasty bug :-) 

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