The Samba-Bugzilla – Bug 4040
Support deep tree mounts
Last modified: 2006-11-02 11:24:30 UTC
The Windows feature of being able to mount //server/share/deep/tree would be nice to have on Linux. The magic being done by a Windows client seems to be to simple prepend all paths sent to the server with /deep/tree, so this shouldn't be that tricky to implement on Linux.
There is a practical feature to this. Doing a deep tree mount requires less access on the server than mounting the share and doing a 'cd' to the relevant subdir. The latter requires the "Read attributes" permission on all intermediate folders on the server.
This could be useful for supporting deep DFS referrals, as well. Bugs 3651 and 3645 describe the problem as it pertains to smbclient.
We use this kind of mounts on windows platform and the starting directories do not have read access (company's management decision), so linux mounts are unable to do 'cd' and thus cannot access the share. The smbclient has such a feature with -D option. Something like this shall be supported by cifs.
This is now implemented in the cifs kernel module (in cifs 1.46, and 2.6.19 kernel). Without changes to the user space mount helper (mount.cifs) it requires that you specify mount option "prefixpath=" on the mount though.
so instead of
mount -t cifs //server/share/deep/tree /mnt
you would type
mount -t cifs //server/share /mnt -o prefixpath=/deep/tree