Re: Msdos name alias patch for 2.1.48

Ingo Molnar (mingo@pc7537.hil.siemens.at)
Thu, 7 Aug 1997 21:08:31 +0200 (MET DST)


we should think about this problem in a different way. The real problem is
not 'lower case and upper case'. The problem is that there are filesystems
that categorize the string namespace in a conceptually different way.
Normal ext2fs has 'aliases' as well: '../mingo/../mingo' is the same
information as '.'.

So the real problem is, that MSDOS has _lookup_ semantics that simply dont
fit into Linux internal namespace lookup logic, without special casing.
And we want to delegate _all_ 'string namespace categorization' (lookup)
activity to the VFS layer.

so either we break this model (no way!), or we force MSDOSFS (users ;) to
fit the semantics of Linux. Fortunately there are almost no applications
that rely on exact MSDOS lookup semantics, apart from things that see
MSDOS created physical file archives directly (unzip, rar, arj, tar), or
cross-filesystem tools (cp -R, cpio, tar). The following libc hack i think
provides a working migration path:

- MSDOSFS is 'nonescaping', names leading into MSDOSFS can never leave
- kernel returns -ENONCANONIC from real_lookup(msdos_lookup()) if
the name is noncanonic
- thus libc can iterate back from the end of the string and translate
to canonic form slowly, until -ENONCANONIC vanishes

the above 'backtrack' thing is certainly slow, but safe and guarantees
correctness in the MSDOS-lookup sense, and can clearly go away after some
time, without affecting the main kernel.

any better solution?

-- mingo