hfsplus bugs in linux-2.6.5

From: Martin Schaffner
Date: Thu May 13 2004 - 18:22:24 EST

Here's how to trigger a hfsplus bug in linux-2.6.5:

dd if=/dev/zero of=/test bs=1k count=10k
newfs_hfs /test
mount -t hfsplus /test /mnt/test -o loop
cd /mnt/test
mkdir a; mkdir b
mv a b

The last command doesn't correctly move "a": it complains that it cannot find "b/a". Effectively, it creates an entry in "b", but that entry doesn't correspond to any actual directory "a". This means I am stuck with a directory "b" which I can't delete with "rm -rf b". However, I can delete it with:

rmdir b; rm -rf b

If above, after creating, mounting and cd-ing to the hfsplus filesystem, I do:

cp -r /whatever/module-init-tools-3.0 .
mkdir m; mv mod* m
rmdir m; rm -rf m
cp -r /whatever/module-init-tools-3.0 .

Then the machine hangs. While I can still change the screen brightness with the topleft keys of the keyboard, I can't change virtual consoles anymore.

A second, less serious wierdness is that directories created with linux are bigger than directories created with Mac OS X: When I do "for ((i=1;i>0;i++)); do mkdir $i; done" on a new 1MB-HFS+-image on Mac OS X, I can create about 6300 directories. With Linux, it's about 3600.
Funny that for both, I can't free up any space afterwards, even if I delete everything inside the volume.

Can someone more knowledgeable look at these bugs? Unfortunately, I don't have a serial port (or second computer with USB port), so I can't do any kernel debugging the usual way.



To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/