read caching across close

Richard Sharpe rsharpe at richardsharpe.com
Thu Apr 29 16:38:40 GMT 2004


On Thu, 29 Apr 2004, Peter Waechtler wrote:

> Am Mittwoch, 28. April 2004 23:03 schrieb Steve French:
> > unless I start doing lazy close of oplocked files (which is an option),
> >
> > Although the cifs vfs gets good cache across close performance in the
> > common case of:
> >
> > 1) open file, get oplock
> > 2) read 1st page
> > 5) close
> > 6) reopen file, get oplock
> > 7) read 1st page out of client's cache
> >
> 
> You give up the oplock when you send a close over the wire.
> IMHO you have to purge the page and read it in again and don't rely
> on the timestamp.
> With a  BATCH oplock you wouldn't sent the close over the wire.
> Instead you start a timer and close the file when a program does
> not open the file again.
> If you close the file - you give up the oplock.

Yes, I have to agree with that. There is an opportunity for someone to get 
at the file between your close and re-open, and given that they could set 
the times to what they were before they messed with the file, you lose.

Regards
-----
Richard Sharpe, rsharpe[at]richardsharpe.com, rsharpe[at]samba.org, 
sharpe[at]ethereal.com, http://www.richardsharpe.com



More information about the samba-technical mailing list