On Sat, 2007-11-10 at 23:32 -0500, Adam McDougall wrote:
No, maildir always uses dotlocks.
This is getting difficult though. After many hours I've finally gotten it to work properly without indexes. But even that required a pretty evil hack. It looks like the only way I can get FreeBSD to flush its filename cache (or whatever it's called that maps filenames to inodes) is to call rmdir() to the directory and hope that it fails with ENOTEMPTY. So this can't be safely done if the directory may be empty, as is easily possible with Maildir/cur and Maildir/new directories..
Wow, scary, but at least finding one awful way to make it work is starting on the road to finding a less awful way :) If I had more time, I'd start looking around the kernel source myself, but I have to get the rest of this project off the ground.
I figured out that rmdir() flushing by looking at FreeBSD sources. :) I also tried a few other ways that looked promising, but nothing else seemed to work.
With indexes enabled it then starts giving errors immediately about transaction logs. I think I'll leave figuring that out for later. I'm guessing the read cache flushing code doesn't work properly either.
No problem, thanks for looking into it. I think I will be satisfied for now with per-server index directories. Do you think it should be safe to have them on NFS as long as only one host accesses that index directory?
Yes.
Also, should I start using dotlock_use_excl anyway as long as it appears to work?
Yes. I might even make it the default, since it's broken only with some really old NFS setups.