In the process of fixing up qa 005, I've found two kernel
bugs, unrelated to XFS. I've attached a patch which fixes
both of them.
1. There's two different checks for hitting the maximum
symlink depth, one with the maximum depth set at 8,
the other at 32. The second one doesn't set the
return code correctly and usually returns EISDIR
instead of ELOOP.
You can test this out by making a chain of symlinks
and then touching each of them, you should see no error
for symlink 1-7, then ELOOP for symlink 8-31, then EISDIR
for 32 on.
2. If you mount "proc" on a read-only FS, then touch it,
you'll hang the filesystem. This seems to be due to
__follow_down returning an error code that is never checked
and namei getting into an infinite loop.
I've changed the loop in question to mimic the checking
done in other places in namei, and it seems to have the
expected behaviour now.
I've attached a patch and a little test script. Note both the
touches of the symlink should return ELOOP and the touch of proc
should do nothing (ie not hang).
I'd appreciate any feedback on the patch available, and some advice
on where to go next would be good..
Ta.
namei.patch
Description: namei.patch
test
Description: test
|