(mmap, munmap) X (msync, NFS)

Bron Gondwana brong at fastmail.fm
Sat Mar 23 19:36:02 EDT 2013


On Fri, Mar 22, 2013, at 11:52 PM, Andre Felipe Machado wrote:
> Hello,
> It seems that cyrus 2.4.16 packaged for Debian Wheezy does not use msync for
> mmap'ed files, but only munmap.
> 
> This is a potential source of trouble with NFS.
> 
> Also, browsing git repo, appears that git 2.4 branch is using msync now.

I don't think so...  I did have a think about switching to using mmap writes
(with the associated msync) - but haven't got there yet.

> Is it correct?
> 
> http://en.wikipedia.org/wiki/Mmap
> http://nfs.sourceforge.net/ Question D8 and D10

The thing is - we never write to mmap files.  We always write direct to the
filehandle.  Mmap is only used for reading.

We are very careful to call fdatasync before close on any file which needs
to be persistent.

Finally, Cyrus will compile with fcntl locking rather than flock locking by
preference.

So it's true we don't msync, but I don't believe it's a bug, because we
aren't writing via mmap.

Bron.
-- 
  Bron Gondwana
  brong at fastmail.fm



More information about the Info-cyrus mailing list