How *exactly* does the file caching mechanism work?

Luke Kenneth Casson Leighton lkcl at
Thu May 28 11:51:31 GMT 1998


in some ways this question, or at least the answer, is best seen on
samba at not just on samba-technical.  i don't recieve the
samba digest, so don't know if you've posted it there.

so.  question.  by "workstation" in paragraph 4, do you mean the
"workstation smb client-side cacheing, which means opportunistic
locking" or do you mean "the foxpro application _running_ on the
workstation which _may_ apply its own read/write cacheing"?

[yes this is an issue: take SourceSafe, for example.  it can apply its own
locking mechanism or it can use the native file system one, and this is
configureable in SourceSafe itself].

if you mean "workstation as in Oplocks" then you are probably hitting a
Win95 client / NT server oplock bug, or just a Win95 oplock bug.  with
samba, if this is a problem, you can disable it by specifying "oplocks =

jeremy had problems with oplocks: he found that win95 didn't bother to
close files, so had to add some code that, oh i don't know, broke the
oplock on last used files or something.

if foxpro has several file handles open you may run into this one, i don't
know.  try "FILES = 90" in config.sys, see what happens.

complete guess-work, mind you...


On Thu, 28 May 1998, Jiva DeVoe wrote:

> Today, a coworker of mine and I had a bit of a debate, and I was hoping
> someone here could resolve the question.  (Incidentally, Microsoft didn't
> seem able to grasp what I was asking when I called them on this)  Originally
> the question came up out of a discussion about NT servers, but I suspect the
> same mechanism works for Samba servers as well, or at least you all might be
> more forthcoming with information than Microsoft was.  (I swear, after 1.5
> hours on hold (no exaggeration) I was told no one knew.)
> Background:
> We're a software company, we write a database application that uses foxpro
> format databases stored on a shared network drive to store our data.  These
> files are shared between multiple workstations running Windows95.  The
> workstations all open the files at the same time, read/write, and perform
> record level operations on the files.
> The question is, if you have two workstations that open the same file on the
> server, A and B, if Workstation A were to lock a record, and write data to
> that record, then unlock the record, then if workstation B were to read from
> that record, would there be any sort of difference between the data?  Orr,
> is the write cache essentially the same data as the read cache?
> What I mean is, the question arises out of the following situation: When you
> have caching enabled on the workstations, there might be a delay between the
> time that the committed data is written and the time that it is actually
> *committed* to the network drive.  This can cause a delay, if I were to try
> to read that data from the fileserver, in when I would actually be able to
> read the data written.  If all caching is *disabled* on the Win95 machine,
> would the NT server cache result in a similar delay?
> The main reason the question came up is because we have experienced data
> corruption in situations where the 95 client machines didn't have caching
> disabled.  As a result, we have required that everyone disable caching on
> the server as well, but I don't think this is really needed.
> Thanks in advance
> Jiva DeVoe

More information about the samba-technical mailing list