vfs_stat called but ignored when client has dir open

Volker Lendecke Volker.Lendecke at SerNet.DE
Mon Apr 23 14:09:10 MDT 2012

On Mon, Apr 23, 2012 at 01:05:34PM -0700, Jeremy Allison wrote:
> On Mon, Apr 23, 2012 at 12:27:18PM -0700, Andrew Klaassen wrote:
> > 
> > [tries] ...doesn't look like that's it; I'm getting the same behaviour with both stat and fstat intercepted.
> > 
> > What's making me think "samba is caching" is the fact that the mtime Samba is sending for testdir isn't testdir's actual mtime (what I'd expect if stat or fstat was being called without being routed through my VFS module), and it isn't testdir.foo's current mtime (the behaviour that I want).
> > 
> > The mtime Samba is sending for testdir is what testdir.foo's mtime ~was~ a few minutes ago when I first opened testdir in Windows Explorer.  Close that Windows Explorer window, and Samba suddenly starts sending testdir.foo's current mtime for testdir as desired.
> > 
> > Here's something interesting: All clients get a cached mtime if any client has a testdir window open.  As soon as that window is closed, all clients can get the latest mtime.
> Ah ok. Now I recall (thanks for reminding me :-). We do it
> that was as it's the way Windows does it. We're caching
> the mtime (write time) inside the share mode entry.
> Look at the get_file_infos() call inside locking/locking.c,
> and the cached time data on the 'struct share_mode_lock'.
> You'll need to modify that if you want to affect mtime
> on an open file.

The question is -- does this also apply to directories on
Windows? (Genuine question, I never tested that).


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