FAQ SearchLogin
Tuxera Home
View unanswered posts | View active topics It is currently Fri Jun 18, 2021 19:27



Post new topic Reply to topic  [ 17 posts ] 
Can't use LFN and SFN at the same time in lowntfs-3g? 
Author Message

Joined: Tue Feb 22, 2011 21:30
Posts: 13
Post Can't use LFN and SFN at the same time in lowntfs-3g?
Hi,

From the latest stable build ntfs-3g.2001.1.15, I'm using lowntfs-3g in order to take advantage of the ignore_case option. However, when I'm traversing any mounted file system from two different terminals at the same time, there seems to be a problem traversing into the same directory using Short File Name in terminal 1, and Long File Name in terminal 2. For example:

# works.
term 1> cd documents\ and\ settings/
term 2> cd documents\ and\ settings/

# works.
term 1> cd docume~1
term 2> cd docume~1

# doesn't work.
term 1> cd documents\ and\ settings/
term 2> cd docume~1
-bash: cd: docume~1: Device or resource busy

# doesn't work.
term 1> cd docume~1
term 2> cd documents\ and\ settings/
-bash: cd: documents and settings: Device or resource busy

Is this a known bug, and if so if there a fix in store soon? Thanks!

-dave


Wed Feb 23, 2011 02:00
Profile

Joined: Tue Feb 22, 2011 21:30
Posts: 13
Post Re: Can't use LFN and SFN at the same time in lowntfs-3g?
Upon further examination, the issue appears to stem from any use of mixed representation for a single directory. LFN vs SFN and mixed case (ie: Users vs UsErS).

# works.
term 1> cd Windows
term 2> cd Windows

# doesn't work.
term 1> cd Windows
term 2> cd windows
-bash: cd: windows: Device or resource busy


Thu Feb 24, 2011 19:40
Profile
NTFS-3G Lead Developer

Joined: Tue Sep 04, 2007 17:22
Posts: 1286
Post Re: Can't use LFN and SFN at the same time in lowntfs-3g?
Hi Dave,

Quote:
I'm using lowntfs-3g in order to take advantage of the ignore_case option. However, when I'm traversing any mounted file system from two different terminals at the same time, there seems to be a problem traversing into the same directory using Short File Name in terminal 1, and Long File Name in terminal 2.

This is apparently hitting a hard limitation in Linux : a directory is supposed to have a single name (hard links to directories are not allowed).
Quote:
Is this a known bug, and if so if there a fix in store soon?

Not known yet, I have to look deeper into it.

Regards

Jean-Pierre


Thu Feb 24, 2011 20:21
Profile

Joined: Tue Feb 22, 2011 21:30
Posts: 13
Post Re: Can't use LFN and SFN at the same time in lowntfs-3g?
Thanks Jean-Pierre, let me know what you discover.

A not-so-elegant workaround that I was able to implement for this bug is to layer ciopfs with lowntfs-3g (ignore case option). The
combination of both seems to allow the mixing directory traversal examples above without any errors.

Clearly not the ideal solution, but ciopfs is somehow getting beyond this limit.

-dave


Thu Feb 24, 2011 22:06
Profile

Joined: Tue Feb 22, 2011 21:30
Posts: 13
Post Re: Can't use LFN and SFN at the same time in lowntfs-3g?
Hi Jean-Pierre,

Have you had a chance to delve into this behavior? Thanks.


Tue Mar 01, 2011 22:18
Profile
NTFS-3G Lead Developer

Joined: Tue Sep 04, 2007 17:22
Posts: 1286
Post Re: Can't use LFN and SFN at the same time in lowntfs-3g?
Hi Dave,

Quote:
Have you had a chance to delve into this behavior?

Yes, I did, but... the error you get is not thrown by ntfs-3g or by fuse. It probably comes from the Linux kernel which locks current directories of processes. This is why you cannot unmount a file system when a process has a current directory on it.

Now, when using the high level of fuse interface (the one used by the standard ntfs-3g), you can use both the long directory name and the short directory name as current directories of different processes. This is because, in this situation, fuse uses its own numbering of inodes and the kernel does not see it is the same directory, but this is probably wrong as it leads to incorrect cacheing and it also probably escapes the lockings needed by concurrent accesses to the same physical directory. I do not know why the directory name comes into play, i would have expected some internal identification such as the inode number, but, as the directories cannot be hard linked, their names are also supposed to be unique references.

I also do not want to renumber the inodes at the low level of fuse interface, in order to get correct concurrent access to hard linked files which the ignore_case option leads to.

Some packages (such as Samba, and probably ciopfs) work around it differently : they first query the parent directory, then they issue the original request with the file name adjusted to actual case. This can be done before the file system is called, but when the call has been issued, it is too late. So this cannot be done in ntfs-3g.

So, no satisfactory solution so far.

Regards

Jean-Pierre


Wed Mar 02, 2011 13:47
Profile

Joined: Tue Feb 22, 2011 21:30
Posts: 13
Post Re: Can't use LFN and SFN at the same time in lowntfs-3g?
Just for record keeping, I experienced this bug on Debian Squeeze 6.0 running the included standard 2.6.32 kernel. I plan on upgrading to a 2.6.37 kernel this week and will report back.


Tue Mar 08, 2011 23:51
Profile

Joined: Tue Feb 22, 2011 21:30
Posts: 13
Post Re: Can't use LFN and SFN at the same time in lowntfs-3g?
Jean-Pierre,

Not a huge surprise, but same behavior is exhibited on debian 6.x running a 2.6.38 kernel. Have you had any ideas how to address this issue? thanks.


Fri Mar 25, 2011 17:08
Profile
NTFS-3G Lead Developer

Joined: Tue Sep 04, 2007 17:22
Posts: 1286
Post Re: Can't use LFN and SFN at the same time in lowntfs-3g?
Hi,

Quote:
Have you had any ideas how to address this issue? thanks.

None, sorry, this is rooted out of my reach, in the Linux kernel. A directory is not supposed to have several names.

Regards

Jean-Pierre


Sat Mar 26, 2011 09:25
Profile

Joined: Tue Feb 22, 2011 21:30
Posts: 13
Post Re: Can't use LFN and SFN at the same time in lowntfs-3g?
Sorry to belabor this point, but with lowntfs, I noticed the following behavior with symbolic links:

root@debian:/mount/windows/programdata# ls -l
total 53
drwxrwxrwx 1 root root 0 Feb 28 2010 adobe
drwxrwxrwx 1 root root 0 Dec 17 04:41 apple
drwxrwxrwx 1 root root 0 Dec 24 21:55 apple computer
lrwxrwxrwx 2 root root 84 Nov 2 2006 application data -> /mount/windows/ProgramData
drwxrwxrwx 1 root root 0 Sep 17 2009 atheros
lrwxrwxrwx 1 root root 120 Nov 2 2006 desktop -> /mount/windows/Users/Public/Desktop
...

root@debian:/mount/windows/programdata# cd application\ data
-bash: cd: application data: Device or resource busy

Is there any way to have the lowntfs symbolic links point to the lower case alternatives? Otherwise we seem to be triggering the same bug again.


Thu Apr 07, 2011 23:31
Profile
NTFS-3G Lead Developer

Joined: Tue Sep 04, 2007 17:22
Posts: 1286
Post Re: Can't use LFN and SFN at the same time in lowntfs-3g?
Hi,

Quote:
Is there any way to have the lowntfs symbolic links point to the lower case alternatives? Otherwise we seem to be triggering the same bug again.

This would indeed be more consistent. Can you try the attached patch ?

Regards

Jean-Pierre


Attachments:
reparse.c.patch05.gz [317 Bytes]
Downloaded 848 times
Fri Apr 08, 2011 10:54
Profile

Joined: Tue Feb 22, 2011 21:30
Posts: 13
Post Re: Can't use LFN and SFN at the same time in lowntfs-3g?
Works like a charm :)

Thank you.

Will this patch be making its way into the codebase at the next release?


Fri Apr 08, 2011 17:40
Profile
NTFS-3G Lead Developer

Joined: Tue Sep 04, 2007 17:22
Posts: 1286
Post Re: Can't use LFN and SFN at the same time in lowntfs-3g?
Hi;
Quote:
Will this patch be making its way into the codebase at the next release?

Yes.

Regards

Jean-Pierre


Mon Apr 11, 2011 08:48
Profile
NTFS-3G Lead Developer

Joined: Tue Sep 04, 2007 17:22
Posts: 1286
Post Re: Can't use LFN and SFN at the same time in lowntfs-3g?
Hi,

Quote:
From the latest stable build ntfs-3g.2001.1.15, I'm using lowntfs-3g in order to take advantage of the ignore_case option. However, when I'm traversing any mounted file system from two different terminals at the same time, there seems to be a problem traversing into the same directory using Short File Name in terminal 1, and Long File Name in terminal 2.

This has been found to be caused by a fuse defect : see http://article.gmane.org/gmane.comp.fil ... evel/10525 (also 10527-10529). The fix is not obvious, and it will require an update to the fuse kernel module. This is out of my reach.

Regards

Jean-Pierre


Sat Jul 09, 2011 08:50
Profile

Joined: Tue Feb 22, 2011 21:30
Posts: 13
Post Re: Can't use LFN and SFN at the same time in lowntfs-3g?
Glad the FUSE team finally got back to you. Thanks for letting us know.


Sun Jul 17, 2011 00:39
Profile
NTFS-3G Lead Developer

Joined: Tue Sep 04, 2007 17:22
Posts: 1286
Post Re: Can't use LFN and SFN at the same time in lowntfs-3g?
Hi,

Quote:
The fix is not obvious, and it will require an update to the fuse kernel module

A fix has been proposed in :
http://article.gmane.org/gmane.comp.fil ... evel/10549
This is a patch to the fuse kernel module. Can you try it ? Do you need help for compiling and updating the kernel module ?
A positive check would be useful for motivating the fuse team to include the patch in future versions.

Regards

Jean-Pierre


Tue Jul 19, 2011 17:25
Profile
NTFS-3G Lead Developer

Joined: Tue Sep 04, 2007 17:22
Posts: 1286
Post Re: Can't use LFN and SFN at the same time in lowntfs-3g?
Hi,

I have uploaded to http://b.andre.pagesperso-orange.fr/debabrata.tgz a script to compile the fuse kernel module for kernels 2.6.35 and 2.6.38 with the patch from Debabrata Banerjee applied. For other kernel versions, you will have to adjust.

Decompress and run the script build.sh. You have to have the kernel headers for the kernel version you are using installed.

Regards

Jean-Pierre


Wed Jul 20, 2011 11:03
Profile
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 17 posts ] 


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Original forum style by Vjacheslav Trushkin.