From roam@FreeBSD.org  Wed Sep 15 18:53:49 2004
Return-Path: <roam@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 5C6F416A4CE
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 15 Sep 2004 18:53:49 +0000 (GMT)
Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 4103C43D1F
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 15 Sep 2004 18:53:49 +0000 (GMT)
	(envelope-from roam@FreeBSD.org)
Received: from freefall.freebsd.org (roam@localhost [127.0.0.1])
	by freefall.freebsd.org (8.12.11/8.12.11) with ESMTP id i8FIrnlQ063973
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 15 Sep 2004 18:53:49 GMT
	(envelope-from roam@freefall.freebsd.org)
Received: (from roam@localhost)
	by freefall.freebsd.org (8.12.11/8.12.11/Submit) id i8FIrnQA063972;
	Wed, 15 Sep 2004 18:53:49 GMT
	(envelope-from roam)
Message-Id: <200409151853.i8FIrnQA063972@freefall.freebsd.org>
Date: Wed, 15 Sep 2004 18:53:49 GMT
From: Peter Pentchev <roam@freebsd.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: NTFS cannot "see" files on a WinXP filesystem
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         71774
>Category:       kern
>Synopsis:       [ntfs] NTFS cannot "see" files on a WinXP filesystem
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-fs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Sep 15 19:00:37 GMT 2004
>Closed-Date:    
>Last-Modified:  Mon May 18 04:28:00 UTC 2009
>Originator:     Peter Pentchev
>Release:        FreeBSD 5.3-BETA4 i386
>Organization:
uh.. let me check my notes..
>Environment:
System: FreeBSD straylight.m.ringlet.net 5.3-BETA4 FreeBSD 5.3-BETA4 #5: Wed Sep 15 12:53:07 EEST 2004     roam@straylight.m.ringlet.net:/fs/5/usr.obj/fs/5/usr.src/sys/WAYLIGHT  i386

This is a 5.x machine CVSup'd and rebuilt every day.
The other partition 'at fault' is a WinXP-style NTFS filesystem, formatted
during the WinXP SP1 installation some time ago.  So far, I've only
seen the problem in WinXP's special 'My Pictures' directory.

>Description:

Sometimes then I transfer files between my Canon PowerShot digital
camera and WinXP (gphoto mostly works, but there are unrelated reasons
for using WinXP some of the time).  Microsoft's Scanner and Camera
Wizard tranfers the pictures and places them into a folder of my choice,
usually within My Documents/My Pictures.

So far the problem has only appeared once, but it had me stumped for a
couple of hours: I had transferred a set of 6 pictures, then, a couple
of days later, tried to access them from FreeBSD, and could not find
them in the directory where I could swear I'd put them before. An 'ls'
on that directory comes up with, well, nothing - no files, no subdirs,
no nothing (well, '.' and '..' are there alright).  The funny part is,
the directory seems to contain DOS-style 8.3 names only, and no NTFS
(type 2) names at all!  A couple of debugging printf's in ntfs_vnops.c
revealed that ntfs_readdir() never sees the directory because
ntfs_ntreaddir() never finds it; it's not a matter of
ntfs_nameispermitted() returning false, as seen from the mount -a case
below.

Since I know nothing about NTFS's directory organization, that's the
point where I give up.  Please tell me what other information you need,
and I'll provide it - well, short of the full 15GB raw partition dump,
since that would be a bit unwieldy to keep in GNATS, besides other
reasons ;)

>How-To-Repeat:

No, I'm not saying you can repeat that by executing the below commands;
still, that's what they do for me.  The 'My Pictures' directory is fine,
but its subdir 'mrs sarbenishka 20040910' contains six files that WinXP
can see just fine, yet FreeBSD's ntfs.ko cannot.  Further down, mounting
with NTFS_MFLAG_ALLNAMES shows six DOS-style names and that's all.

Script started on Wed Sep 15 21:35:46 2004
Starting interactive C shell
[roam@straylight ~]> sudo mount /fs/win/c
[roam@straylight ~]> ls /fs/win/c/Documents\ and\ Settings/roam.SBND/My\ Documents/My\ Pictures/
Desktop.ini			rodopi 20040905
Sample Pictures.lnk		sof 2004-06-16
mrs sarbenishka 20040910	tryn 20040912
muselica.zip			unproc
rado 2004-07-18			unproc.zip
[roam@straylight ~]> ls /fs/win/c/Documents\ and\ Settings/roam.SBND/My\ Documents/My\ Pictures/mrs\ sarbenishka\ 20040910/
[roam@straylight ~]> sudo umount /fs/win/c
[roam@straylight ~]> fgrep /fs/win/c /etc/fstab
/dev/ad0s3		/fs/win/c	ntfs	ro,noauto	0	0
[roam@straylight ~]> sudo mount_ntfs -o ro,noauto -a /dev/ad0s3 /fs/win/c
[roam@straylight ~]> ls /fs/win/c/Documents\ and\ Settings/roam.SBND/My\ Documents/My\ Pictures/mrs\ sarbenishka\ 20040910/
RO6354~1.JPG	RO6754~1.JPG	RO6F44~1.JPG
RO6364~1.JPG	RO6B54~1.JPG	RO6F54~1.JPG
[roam@straylight ~]> ls /fs/win/c/Documents\ and\ Settings/roam.SBND/My\ Documents/My\ Pictures/
Desktop.ini			mrs sarbenishka 20040910
MRSSAR~1			muselica.zip
RADO20~1			rado 2004-07-18
RODOPI~1			rodopi 20040905
SAMPLE~1.LNK			sof 2004-06-16
SOF200~1			tryn 20040912
Sample Pictures.lnk		unproc
TRYN20~1			unproc.zip
[roam@straylight ~]> sudo umount /fs/win/c
[roam@straylight ~]> exit
exit

Script done on Wed Sep 15 21:36:47 2004

>Fix:

Hopefully one can be found before 5.3 ships :)  Not critical in any way,
though.
>Release-Note:
>Audit-Trail:

From: Peter Pentchev <roam@ringlet.net>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/71774: NTFS cannot "see" files on a WinXP filesystem
Date: Wed, 15 Sep 2004 22:23:09 +0300

 On Wed, Sep 15, 2004 at 06:53:49PM +0000, Peter Pentchev wrote:
 [snip]
 > So far the problem has only appeared once, but it had me stumped for a
 > couple of hours: I had transferred a set of 6 pictures, then, a couple
 > of days later, tried to access them from FreeBSD, and could not find
 > them in the directory where I could swear I'd put them before. An 'ls'
 > on that directory comes up with, well, nothing - no files, no subdirs,
 > no nothing (well, '.' and '..' are there alright).
 
 Of course, here I mean 'nothing unless the show-all-filenames flag is
 set on mounting'.
 
 > The funny part is,
 > the directory seems to contain DOS-style 8.3 names only, and no NTFS
 > (type 2) names at all!
 
 And here I certainly mean 'NOT type 2' :)
 
 G'luck,
 Peter
 
 -- 
 Peter Pentchev	roam@ringlet.net    roam@cnsys.bg    roam@FreeBSD.org
 PGP key:	http://people.FreeBSD.org/~roam/roam.key.asc
 Key fingerprint	FDBA FD79 C26F 3C51 C95E  DF9E ED18 B68D 1619 4553
 I am jealous of the first word in this sentence.
Responsible-Changed-From-To: freebsd-bugs->freebsd-fs 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Mon May 18 04:27:52 UTC 2009 
Responsible-Changed-Why:  
Over to maintainer(s). 

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