Just-in-time mounts when following symlinks

Albert Chin-A-Young china at pprd.abbott.com
Thu Jun 4 21:34:31 GMT 1998


On Thu, 4 Jun 1998, Jeremy Allison wrote:

>Albert Chin-A-Young wrote:
>> 
>> Ok, following discussions with Paul Epp <epp at clrtech.bc.ca>, there are
>> a total of three ways to solve this problem:
>>         1. Add the following options to smb.conf:
>>                 jit symlinks = yes/no
>>                 file symlinks = [pointer to file with REs]
>>                 directory symlinks = [pointer to file with REs]
>>            Then wrap calls to stat() accordingly so that symbolic
>>            links in a particular directory are treated as files
>>            or directories and force lstat() on them. The
>>            'jit symlinks' stands for 'just-in-time symlinks' and
>>            would enable this feature. This would be a general-
>>            purpose mechanism for anyone with trees of symbolic
>>            links.
>
>What are the speed considerations of this ?
>
>The stat system call is one of the most common within
>Samba, in fact one of the optimizations (I will get
>around to one day :-) would be to optimize out as
>many of these stat calls as possible, ensuring they
>are only done once per pathname.
>
>My fear with the solution you propose is that it will
>be horribly slow, due to the extra overhead in processing 
>stat calls.

What you say makes sense. This certainly depends on the list of items
in the 'file symlinks' and 'directory symlinks' options. As they're
REs, you'd have to match for every symbolic link you find (not every
file). I don't see us losing when deciding whether or not to do stat()
v. lstat() but the RE matching might definitely be a performance hit.
In practice, I'd expect people to have one directory tree of symbolic
links (for the automounter keys) and for that to be the only directory
specified in 'directory symlinks'.

>	Jeremy Allison,

-- 
albert chin (china at pprd.abbott.com)



More information about the samba-ntdom mailing list