What was/is the purpose of the getwd cache?

Volker Lendecke Volker.Lendecke at SerNet.DE
Wed Jun 13 05:58:34 MDT 2012

On Wed, Jun 13, 2012 at 11:42:57AM +0200, Andreas Schneider wrote:
> On Tue 12.Jun.12 14:00, Jeremy Allison wrote:
> >On Tue, Jun 12, 2012 at 01:55:36PM -0700, Richard Sharpe wrote:
> >>Hi folks,
> >>
> >>What happens if I set 'getwd cache = no'?
> >
> >smbd will stop using the getwd cache. See this comment
> >in the code:
> >
> >       /*
> >        * We don't have the information to hand so rely on traditional
> >        * methods. The very slow getcwd, which spawns a process on some
> >        * systems, or the not quite so bad getwd.
> >        */
> >
> >Probably these days getwd is reasonably fast. But this is
> >an *OLD* optimization.
> >
> This raises the question for which systems it is still needed and can we
> get rid of it for 4.0 :)

Thinking about a more radical change (that would definitely
fuel the parallel OEM discussion): The s4 file server works
with absolute path names, s3 does a chdir to the share root
for every smb request. This is a pretty deep assumption that
from my point of view is broken. If we look for a point to
change that (it affects the VFS), 4.0 would be it. If we got
rid of relative path names, getwd would be simple: Always
return /. No caching required.


SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
http://www.sernet.de, mailto:kontakt at sernet.de

More information about the samba-technical mailing list