Just-in-time Symlinks

David Collier-Brown davecb at canada.sun.com
Mon Jun 18 14:02:59 GMT 2001

Michael H Buselli wrote:
> To re-iterate the problem, we have the Berkeley AMD automounter mounting
> NFS shares that we then want to re-export with Samba.  We have the
> "disappearing mount points" problem that is all too well known when
> automounters are involved.  The just-in-time code wraps calls to
> sys_stat() within Samba and returns fake information instead of calling
> stat() if we are working on a symbolic link to prevent mount storms
> while programs peruse the browsing directories.

	Perhaps we're trying to deal with a symptom rather than
	the problem...

	If one uses automounter to import file trees which 
	one exports with Samba, there is a well-known problem
	with the *%$#$%!@ thing timing out and unmounting the
	file trees.  Samba users see this as an unexpectedly 
	empty directory when browsing.

	At the same time, several automounters contain optimizations
	which allow them to stat the files in automounted directories
	without actually making the mounts, which allows programs	
	calling stat (like ls -l) to be run on automounted directories
	without unexpected side-effects.

	Samba should be able to 
		1) list a directory without causing a mount storm
		2) be able to see the contents of an automounted
	both in terms of the operations that a pc client will request.

	So, except for the last caveat, Samba needs to act like
	a perfectly ordinary Unix program.  I'm actually surprised
	to find it doesn't!

	As I once asked "what the Microsoft client requires
       	so that we might debate what to do instead of
        how to do it?"

	Can anyone comment on the windows side?  

	I have a 2.2.x Samba on my workstation and a share pointed
	at /net, the local automounted NFS tree. using **smbsh**,
	"ls /net" works normally:
smbsh$ ls /net
RadioFreeEthernet  dhcp-mrk03-8-165   merlin             sco
ace                dhcp-mrk03-8-166   millenium          scooter
[rest snipped]

	"ls -l /net" triggers the OS's underlying stat simulation,
	so that most directories only show the default permissions
	and change times (/net/elmo), and only actually mounted
	directories show the real information (/net/elsbeth)
mbsh$ ls -ld /net/e*
dr-xr-xr-x   1 root     root           1 Jun 18 09:56 /net/elmo
drwxr-xr-x  32 root     root        1024 Jun 12 11:08 /net/elsbeth
dr-xr-xr-x   1 root     root           1 Jun 18 09:57 /net/ep
dr-xr-xr-x   1 root     root           1 Jun 18 09:57 /net/excalibur

	So **almost** everything works, it's only PC clients
	that get messed up.  Who can help us with that???

> If anyone knows how to solve our problem without code modifications to
> the current Samba code, please let me know so we can avoid anything
> unnecessary.  

	I suspect, without any evidence (;-)), that Samba needs
	some small tweak or two to produce the PC's desired

David Collier-Brown,           | Always do right. This will gratify 
Performance & Engineering Team | some people and astonish the rest.
Americas Customer Engineering  |                      -- Mark Twain
(905) 415-2849                 | davecb at canada.sun.com

More information about the samba-technical mailing list