Re: Msdos name alias patch for 2.1.48

Werner Almesberger (almesber@lrc.di.epfl.ch)
Sat, 9 Aug 1997 00:20:16 +0200 (MET DST)


Albert D. Cahalan wrote:
> There is a solution that gets rid of all the gross hacks.
> The official FAT filesystem has long case-preserving filenames.

Hmm, are you proposing to _store_ mixed case in an old FAT FS ? Very
bad idea. First, it may break DOS in subtle ways, who knows. Second,
it'll probably break DOS or Windows programs. Third, there are
non-DOS systems using the FAT file system. Good luck with those ...

If you're proposing just to remember the case (in a cache) but to
store the "normal" name in the FS, then you have three problems:
1) your cache may get big. 2) automounters that occasionally try
to unmount apparently unused directories. 3) programs that
remember the file names they used in persistent storage.

Maybe we need just FS-specific dcache name handling functions. In
my last posting, I didn't consider case insensitive but case
preserving (CICP ? :-) file systems a la AFFS or HPFS. I guess the
only correct way to treat those is to pass the canonical name to
dcache and to pass the original name to the FS operations. So we'd
get

Unix: app_name --------------> dcache
--> FS_op

DOSish: app_name --> mangler --> dcache
--> FS_op --> mangler ... (invisible to VFS)

HPFSish: app_name --> mangler --> dcache
--> FS_op

I'm not quite sure why cached_lookup and real_lookup both need to
d_lookup, but it seems that only d_lookup and d_move actually
use names, and d_move could probably just use the dentry of the
new name instead, so the only name use is through d_lookup and
a VFS lookup_cached op could handle that just nicely (for ext2,
it'd be a pointer to a d_lookup+hashing, of course).

Am I missing something ? (BTW, I didn't quite understand Andreas'
comment about breaking hashing. Of course you'd have to do it at
a different place than now, i.e. in lookup_cached or such, but
that shouldn't be a problem.)

Again, apologies for prolonging this thread if Alain's patch (which
I unfortunately deleted) was already doing all of this.

> While dotsOK is not important, killing it does not make this
> any better or worse.

Agreed. Actually, given that it's there already, killing it may
create small compatibility problems, so better leave it as it is.

> We should only match on the name that shows up in a directory
> listing.

This would create horrible compatibility problems with programs
that transform file names, e.g.

% touch foo.bar
% dosemu_script foo.bar

which does the equivalent of

do_sth_with `basename $1`.BAR

(Okay, maybe that's a slightly exotic case ;-)

I'm sure such beasts are around and I don't even want to think
about applications that are written to some input mask-style
interface (e.g. dBASE). I guess there's a reason why DOSEMU and
WINE do their own mangling.

- Werner

-- 
  _________________________________________________________________________
 / Werner Almesberger, DI-LRC,EPFL,CH   werner.almesberger@lrc.di.epfl.ch /
/_IN_R_133__Tel_+41_21_693_6621__Fax_+41_21_693_6610_____________________/