Folks, I think that patch is stable enough (==works here), but
I'ld like to see some success/horror stories before submitting it to
Linus.
        Summary: for normal symlinks (== static ones, with usual relation
between readlink() and follow_link()) one cann give ->getlink() method and
use generic_readlink() and generic_follow_link() as ->readlink() and
->follow_link() resp. It removes tons of code duplication, both between
foofs_readlink() and foofs_follow_link() _and_ between the filesystems.
See the patch for examples - they should be obvious enough. More details
can be found in fs/nameidata.c (large comment in the beginning).
        Moreover, this seriously cuts down on the amount of stack space
eaten by recursion in do_follow_link() - generic_follow_link() is pretty
light and it calls lookup_dentry() after ->getlink(). So if filesystem
eats a lot of stack space in reading symlink contents we are getting at
most one instance in the stack - they do not accumulate. For filesystems
that use generic_follow_link() the stack footprint of one level of
recursion (do_follow_link() to ->follow_link() to lookup_dentry() to
do_follow_link()) is about 100 bytes now - more than enough to lift the
depth limit.
        Filesystems that do not want to use it can remain unmodified - old
code still works.
        Please, test the thing. It didn't eat any of my filesystems and
I'm running it since Spring with few modifications. However, it's still
beta code, and all usual precautions apply.
        Patch on ftp.math.psu.edu/pub/viro/symlink-patch-12.gz
                                                        Cheers,
                                                                Al

Reply via email to