Skip to contentSkip to conversation

JFFS2 case insensitivity

DISCUSSION Jarkko Lavinen 3 participants 8 messages Jan 27, 2004 – Feb 20, 2004 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

How difficult it would be to add support for file name case insensitivity to JFFS2?

Jarkko Lavinen

#1 lore raw
Quoted 2 lines · Jarkko Lavinen

How difficult it would be to add support for file name case insensitivity to JFFS2?

Fairly, It's ugly, evil and painful when FAT tries to do it, and it wouldn't be any less so in JFFS2. I suspect you'd be far better off doing it in userspace.

In the kernel, you end up with 'interesting' dcache coherency problems and charset problems and generally end up going insane.

What precisely is the problem you're trying to solve?

Signature · 1 line
dwmw2
#2 lore raw

On Tue, Jan 27, 2004 at 11:13:28AM +0000, David Woodhouse wrote:>

Quoted 1 line

What precisely is the problem you're trying to solve?

User space people want the file name case insensitivity. I guess the old files are likely to be selected from a list on an embedded device. However case insensitivity is a desirable feature when adding new file names.

My primary concern was to estimate the cost or pain of implementing file name case insensitivity and find arguments against doing it in the kernel.

Jarkko Lavinen

#3 lore raw
Quoted 4 lines · Jarkko Lavinen

User space people want the file name case insensitivity. I guess the old files are likely to be selected from a list on an embedded device. However case insensitivity is a desirable feature when adding new file names.

What do you mean, precisely? You're still describing the imagined solution rather than the problem.

Case sensitivity is more clearly applicable in _lookup_ -- when trying to find a given file from its name.

In the case of file _creation_, that affects the collision detection -- case insensitivity will usually cause you to be forbidden from creating a new file with a name which differs from an existing name only in case.

Is that what they want it for? Why -- what is the real source of the requirement?

Quoted 3 lines

My primary concern was to estimate the cost or pain of implementing file name case insensitivity and find arguments against doing it in the kernel.

It is fairly painful -- you have to provide your own dentry_ops for comparison and hashing, which mostly sorts out the evil dcache coherency issues we used to have with case-insensitivity.

But you still have to know the character set. That was vaguely OK for FAT, where we had to play charset games anyway, but I _really_ don't want to have the JFFS2 code play with character sets and know that û is really the same as Û, etc. And don't get me started on Ŵ and ŵ :)

You really ought to be able to do this in userspace.

Signature · 1 line
dwmw2
#4 lore raw
Quoted 8 lines · David Woodhouse
Quoted 3 lines

My primary concern was to estimate the cost or pain of implementing file name case insensitivity and find arguments against doing it in the kernel.

It is fairly painful -- you have to provide your own dentry_ops for comparison and hashing, which mostly sorts out the evil dcache coherency issues we used to have with case-insensitivity.

Quoted 6 lines

But you still have to know the character set. That was vaguely OK for FAT, where we had to play charset games anyway, but I _really_ don't want to have the JFFS2 code play with character sets and know that û is really the same as �, etc. And don't get me started on Ŵ and ŵ :)

You really ought to be able to do this in userspace.

I agree completely with David.

I had to add case insensitivity to YAFFS for WinCE. There were enough wierd things just to make that work. On top of that, with Linux there is all the overhead of modifying dentry behaviour, handling renaming oddities etc. This is non-trivial to get right.

Doing this in user space is by far the easiest.

-- Charles

#5 lore raw
Quoted 4 lines · Charles Manning
Quoted 3 lines · David Woodhouse

I _really_ don't want to have the JFFS2 code play with character sets and know that û is really the same as �, etc. And don't get me started on Ŵ and ŵ :)

Quod Erat Demonstrandum. :)

Signature · 1 line
dwmw2
#6 lore raw
In reply to Jarkko Lavinen
Quoted 3 lines · Jarkko Lavinen

My primary concern was to estimate the cost or pain of implementing file name case insensitivity and find arguments against doing it in the kernel.

See the linux-kernel mailing list (search for 'UTF-8 and case-insensitivity').

Signature · 1 line
dwmw2
#7 lore raw
In reply to Jarkko Lavinen
Quoted 2 lines · Jarkko Lavinen

How difficult it would be to add support for file name case insensitivity to JFFS2?

I'm dubious about the need for this.

You only need case insensitivity when the filename you're given is wrong in case only -- which is basically only if you're taking input from the user and trying to look up a filename directly, surely?

On an embedded device, how often are your filenames coming from external sources in that way, rather than being chosen by the user from a list?

Even then, it should be easy enough to do it in userspace if you really need it.

Unless, of course, you're pondering a port to WinCE. In which case it's easier than it would be under Linux. You don't actually _use_ the readdir() and lookup() functions which the Linux version uses, you implement real FindFirst() and FindNext() functions directly on top of the JFFS2 core code, and can do what you want.

Signature · 1 line
dwmw2