On Mon, Oct 21, 2002 at 04:15:28PM +0300, Timo Sirainen wrote:
Requiring msync() is fine, that's done after each change, but there should be better solution than re-mmap()ing to notice the changes. I think FreeBSD checked the changes after fcntl() locking changes :)
Hmm. More bad news; flock() doesn't work over NFS. That is, local processes see and honor the lock even on NFS filesystems, but other machines don't see the lock at all. fcntl() doesn't work at all (but that's probably because we're not running lockd.)
I've tried various ways of forcing other machines to update their filesystem cache without doing something on those machines (so you can optionally do that after the msync()) by changing atime, mtime, nlinks, but so far, nothing. I should point out that the file-metadata (mtime/ctime/nlinks) returned by fstat() sometimes do get updated, and sometimes they don't. Same for stat().
That aside, this issue isn't that big an issue for us. The same-client-connecting-twice case we can solve by configuring the layer-4 ethernet switch to connect the same ipaddress to the same real server, so that mmaps() are properly shared and all. We might want per-mailbox locks so that only one real server can open a specific mailbox (but do so multiple times) but I'll figure that one out later.
-- Thomas Wouters <thomas@xs4all.net>
Hi! I'm a .signature virus! copy me into your .signature file to help me spread!