Re: [PATCH vfat] allow retrieving entries with trailing dots

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Philippe De Muyter
Date: Thursday, March 11, 2010 - 5:02 am

Hello Ogawa,

On Thu, Mar 11, 2010 at 06:26:54PM +0900, OGAWA Hirofumi wrote:

We could perhaps reduce the disadvantage by moving the logic (test first
with the trailing dots, and then without if needed) into fat_search_long
instead of putting it in vfat_find as my patch proposal does.  This way
the name to find would only be compared once to unrelated entries,
instead of possibly twice as my patch does.

But therefore I need your help : fat_search_long isn't easy to read/modify.

The logic could be modified as such :
    - if the searched name contains trailing dots, first compare
	the truncated part to the same length of the directory entry
    - if they are the same, test the length of the rest of the directory entry
	- if length_of_rest is 0, this could be the matching entry,
	    but there could be a better one later; keep searching till the end.
	- if length_of_rest is not 0, compare the rest with the trailing dots
	    - if rests are equal, we have found it; return
	    - if rests are unequal, continue searching


A new mount option should be the last programming option.  It is better to
automatically do the right thing than to require the user to figure out
he must add a mount option in /etc/fstab or whatever.  Remember this is
for hot-plug disks.


Yes, you can remove any existing file, but if you want to create a file, 
the name creation rules are kept unchanged. So, creating "a." will
succeed, it will actually be called "a" on disk, but you can still refer
to it as "a." : that will succeed.  That's the strange part of the behavior
but that part is already present for compatibility reasons nor you nor me
can do anything about :(


It's a compromise to avoid creating name entries that are not universally
accepted, but to allow accessing existing files and directories.

The mount option could be useful then to allow the creation of file and
directory names with trailing dot, but consistency between getdents and
stat/open must be automatic.

Best regards

Philippe
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH vfat] allow retrieving entries with trailing dots, Philippe De Muyter, (Wed Mar 10, 5:32 am)
Re: [PATCH vfat] allow retrieving entries with trailing dots, Philippe De Muyter, (Wed Mar 10, 9:14 am)
Re: [PATCH vfat] allow retrieving entries with trailing dots, OGAWA Hirofumi, (Wed Mar 10, 10:16 am)
Re: [PATCH vfat] allow retrieving entries with trailing dots, Philippe De Muyter, (Wed Mar 10, 4:58 pm)
Re: [PATCH vfat] allow retrieving entries with trailing dots, Philippe De Muyter, (Thu Mar 11, 5:02 am)
Re: [PATCH vfat] allow retrieving entries with trailing dots, Philippe De Muyter, (Sat Mar 13, 4:31 am)
Re: [PATCH vfat] IOMEGA network drive compatibility, Philippe De Muyter, (Sun Mar 14, 3:39 am)
Re: [PATCH vfat] IOMEGA network drive compatibility, OGAWA Hirofumi, (Sun Mar 14, 4:17 am)
Re: [PATCH vfat] IOMEGA network drive compatibility, Philippe De Muyter, (Sun Mar 14, 7:13 am)
Re: [PATCH vfat] IOMEGA network drive compatibility, OGAWA Hirofumi, (Sun Mar 14, 7:52 am)