>> It actually does use MAP_SHARED already, but only for reading.As noted above, one thing cyrus does which does seem to be plain "wrong" is that it mmaps a region greater the file size (rounds to an 8k boundary, but 8k-16k past the current end of the file) and then assumes that when it writes to the end of the file (but less than the end of the mmap region) that there's no need to remmap and that data is immediately available within the previous mmaped region. Apparently that works on most OS's (but is what this bug actually exposed), but according to the mmap docs: --- If the size of the mapped file changes after the call to mmap() as a result of some other operation on the mapped file, the effect of references to portions of the mapped region that correspond to added or removed portions of the file is unspecified. --- The way I read that, even if you mmap a file with a size past the end of the file currently, if you subsequently write to the end of that file, you shouldn't assume that written data is available in the region you previously mmaped, which cyrus definitely does do. Amazingly (apart from HP/UX) no OS actually seems to have a problem with this since there would be massive cyrus bug reports otherwise. Rob ---------- robm@fastmail.fm Sign up at http://fastmail.fm for fast, ad free, IMAP accessible email --
| Greg Kroah-Hartman | [PATCH 027/196] tifm: Convert from class_device to device for TI flash media |
| Kok, Auke | Re: Linux 2.6.21-rc1 |
| Trent Piepho | Re: [PATCH] [POWERPC] Improve (in|out)_beXX() asm code |
| Greg KH | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
git: | |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| Arjan van de Ven | Re: [GIT]: Networking |
| Ingo Molnar | Re: [PATCH 01/10] x86: add Kconfig entry for DMA-API debugging |
| Jarek Poplawski | [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
