Bug 7240 - can't change filename case on a non case sensitive hfsplus.
Summary: can't change filename case on a non case sensitive hfsplus.
Status: CLOSED CODE_FIX
Alias: None
Product: File System
Classification: Unclassified
Component: HFS/HFSPLUS (show other bugs)
Hardware: i386 Linux
: P2 normal
Assignee: Roman Zippel
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-09-30 20:29 UTC by didier
Modified: 2008-03-30 12:29 UTC (History)
2 users (show)

See Also:
Kernel Version: 2.6.17
Subsystem:
Regression: ---
Bisected commit-id:


Attachments
custom dentry hash and comparison operations (9.04 KB, patch)
2007-06-17 10:35 UTC, Duane Griffin
Details | Diff
test script to generate and lookup filenames of varying case (716 bytes, text/plain)
2007-06-17 10:46 UTC, Duane Griffin
Details

Description didier 2006-09-30 20:29:37 UTC
Most recent kernel where this bug did not occur:
Distribution: ubuntu
Hardware Environment: ppc Mac
Software Environment:
Problem Description: You can't rename foo to Foo because hfsplus wrongly create
2 dentries for foo and Foo.


Note: the steps below work when the fs is jfs (OS2 compatible mode).

Steps to reproduce:
from a shell command line. (this is more or less what nautilus does)
$ > foo

$ stat foo

$ stat Foo

$ mv foo fooBAR

$ stat Foo 
Here it should return an error.
Comment 1 Duane Griffin 2007-06-17 10:35:15 UTC
Created attachment 11769 [details]
custom dentry hash and comparison operations

This patch adds dentry operations to do filename comparison and hashing. If the filesystem is case-sensitive and the NODECOMPOSE flag is set the generic dentry operations are used, as they are now.

In order to implement the case-insensitive/decomposing comparison and hashing the logic inside hfsplus_asc2uni function has been factored out and reused. For submission to the HFS+ maintainer and LKML I'll split the initial refactoring work into a separate patch.

This has been tested on i386 and x86_64. Tests on PPC and/or feedback on the patch would be much appreciated.

See also:
http://bugs.gentoo.org/show_bug.cgi?id=178298
Comment 2 Duane Griffin 2007-06-17 10:46:56 UTC
Created attachment 11770 [details]
test script to generate and lookup filenames of varying case

Perl test script that generates a file with a composed unicode character then attempts to access it through various equivalent filenames. Should fail without the patch and succeed with it (on a case-sensitive filesystem).
Comment 3 didier 2007-06-18 16:38:00 UTC
 
> This has been tested on i386 and x86_64. Tests on PPC and/or feedback on the
> patch would be much appreciated.
Works on PPC G4, tested with Ubuntu Linux 2.6.22-rc3 kernel.
Comment 4 Duane Griffin 2007-06-19 05:03:18 UTC
Thanks very much!
Comment 5 Natalie Protasevich 2007-07-06 22:43:14 UTC
Duane, are you planning on submitting the patch?
Thanks.
Comment 6 Duane Griffin 2007-07-09 06:57:54 UTC
I've submitted it to Roman and LKML. Roman fixed a couple of things and made some improvements, after which akpm picked it up for -mm. As I understand it, assuming no problems are found in -mm, it will be merged into mainline for 2.6.24.

You can get the latest version of the patches, as they are in -mm, from here:

ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.22-rc6/2.6.22-rc6-mm1/broken-out/hfs-refactor-ascii-to-unicode-conversion-routine.patch
ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.22-rc6/2.6.22-rc6-mm1/broken-out/hfs-refactor-ascii-to-unicode-conversion-routine-fix.patch
ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.22-rc6/2.6.22-rc6-mm1/broken-out/hfs-add-custom-dentry-hash-and-comparison-operations.patch
Comment 7 Natalie Protasevich 2008-03-30 12:29:00 UTC
Great, thanks. Closing the bug.

Note You need to log in before you can comment on or make changes to this bug.