From drwilco@venus.drwilco.net  Fri Nov 10 14:23:30 2000
Return-Path: <drwilco@venus.drwilco.net>
Received: from venus.drwilco.net (10dyn125.dh.casema.net [212.64.31.125])
	by hub.freebsd.org (Postfix) with ESMTP id B927E37B479
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 10 Nov 2000 14:23:28 -0800 (PST)
Received: (from drwilco@localhost)
	by venus.drwilco.net (8.11.1/8.11.1) id eAAMK5J04953;
	Fri, 10 Nov 2000 23:20:05 +0100 (CET)
	(envelope-from drwilco)
Message-Id: <200011102220.eAAMK5J04953@venus.drwilco.net>
Date: Fri, 10 Nov 2000 23:20:05 +0100 (CET)
From: drwilco@drwilco.nl
Sender: drwilco@venus.drwilco.net
Reply-To: drwilco@drwilco.nl
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: ntfs filesystems can be listed, but no files can be read
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         22756
>Category:       kern
>Synopsis:       ntfs filesystems can be listed, but no files can be read
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Nov 10 14:30:00 PST 2000
>Closed-Date:    Fri Nov 17 18:47:43 PST 2000
>Last-Modified:  Fri Nov 17 18:49:15 PST 2000
>Originator:     Rogier R. Mulhuijzen
>Release:        FreeBSD 5.0-CURRENT i386
>Organization:
>Environment:
System: FreeBSD venus.drwilco.net 5.0-CURRENT FreeBSD 5.0-CURRENT #0: Thu Nov 9 12:00:08 CET 2000 root@venus.drwilco.net:/usr/src/sys/compile/VENUS i386

>Description:
Since somewhere in October (on 5.0-CURRENT) files on a NTFS filesystem cannot be read, although directory listings can be made. The error returned is "Inappropriate ioctl for device"
>How-To-Repeat:
Mount a NTFS partition, try to cat(1) a file.
>Fix:

ntfs_bypass() always returns ENOTTY (Inappropriate ioctl for device), and is only used for vop_default_desc. Looking at other fs's I came to the conclusion that they almost all use vop_defaultop() for vop_default_desc, or code that is exactly the same. Hence the following patch, which works fine for me.

--- ntfs/ntfs_vnops.c.old	Wed Nov  1 18:57:24 2000
+++ ntfs/ntfs_vnops.c	Fri Nov 10 22:56:32 2000
@@ -847,7 +847,7 @@
 #if defined(__FreeBSD__)
 static
 struct vnodeopv_entry_desc ntfs_vnodeop_entries[] = {
-	{ &vop_default_desc, (vop_t *)ntfs_bypass },
+	{ &vop_default_desc, (vop_t *)vop_defaultop },
 
 	{ &vop_getattr_desc, (vop_t *)ntfs_getattr },
 	{ &vop_inactive_desc, (vop_t *)ntfs_inactive },
@@ -887,7 +887,7 @@
 #else /* !FreeBSD */
 
 struct vnodeopv_entry_desc ntfs_vnodeop_entries[] = {
-	{ &vop_default_desc, (vop_t *) ntfs_bypass },
+	{ &vop_default_desc, (vop_t *) vop_defaultop },
 	{ &vop_lookup_desc, (vop_t *) ntfs_lookup },	/* lookup */
 	{ &vop_create_desc, genfs_eopnotsupp },		/* create */
 	{ &vop_mknod_desc, genfs_eopnotsupp },		/* mknod */

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: bp 
State-Changed-When: Fri Nov 17 18:47:43 PST 2000 
State-Changed-Why:  
Committed, thanks! 

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