Re: Msdos name alias patch for 2.1.48

Andreas Schwab (
Wed, 6 Aug 97 11:39:46 +0200

Alain Knaff@poboxes com <> writes:

|> The following patch is another attempt to fix name aliases. It is
|> done against 2.1.48. The name aliasing problem can be shown as
|> follows:

|> # mount -t msdos /dev/fd0 /mnt
|> # echo xyz >/mnt/abc
|> # cat /mnt/Abc
|> xyz
|> # rm /mnt/abc
|> # cat /mnt/Abc
|> xyz

|> The solution that I tried this time involves a scheme similar to the
|> one outlined by the original xlate_name_char code. However, it is
|> also combined with a filesystem specific name comparison function. By
|> default (i.e. non-msdos), the name comparison function is memcmp; and
|> for msdos it is a new function which formats names using
|> msdos_format_name before comparing them.

Please note that other filesystems also need to deal with aliases because
they truncate or mangle names (minixfs truncates at 14 or 30 characters,
nfs might have other limits imposed by the server, and isofs needs to deal
with this too). A better approach might perhaps be if xxx_lookup not only
creates the dentry for the original name, but also for a `canonical' name,
ie., the name it would return in xxx_readdir. These two dentries need to
be coupled together so that lookup_dentry know about choosing the
canonical entry when the alias is looked up. This way the ext2fs will
have zero overhead (it never truncates or otherwise mangles filenames),
and lookup_dentry would only have to check one pointer to see if a
`canonical' dentry exists (never on ext2fs). All complexity would be
located in the fs specific xxx_lookup on non-ext2 filesystems.

If this looks like a good idea i'll try to implement this.


Andreas Schwab                                      "And now for something              completely different"