On Sat, 2007-11-17 at 19:46 -0500, Trond Myklebust wrote:
> Right. I understood that you were not using fcntl() locks. Those will
> in
> any case ensure cache revalidation, so you wouldn't have to use
> anything
> else.
I just noticed that FreeBSD's fcntl() locking doesn't flush either
attribute or data cache. So things seem to be a lot more difficult to
handle with it.
> On Sun, 2007-11-18 at 02:26 +0200, Timo Sirainen wrote:
> > Most people are using NetApps, and they also seem to have 1 second
> > resolution (at least the one I just tested had). So this isn't a
> > solution. "Let's hope that there are no writes less than 1 second
> > apart" isn't really a solution either. People like their mailboxes
> > uncorrupted.
>
> No. NetApp filers and WAFL have nanosecond resolution. They should be
> fine.
I guess I ran my test accidentally on local filesystem. I see only
microsecond resolution though, the last 3 digits in st_mtim.tv_nsec are
always zeroes. But maybe that's enough to be trusted.
Looks like this mtime checking works only with close+open, but not with
fchown()ing the file. That explains a few other things I was mistaken
about as well.
BTW. I've been writing these things down to
http://iki.fi/tss/nfs-coding-howto.html. Would be nice to know if there
are still some mistakes in it.