|Summary:||memory mapped files are not flushed to disk before munmap.|
|Product:||[Retired] Red Hat Linux||Reporter:||Keith Ansell <keitha>|
|Component:||kernel||Assignee:||Stephen Tweedie <sct>|
|Status:||CLOSED NOTABUG||QA Contact:||Brian Brock <bbrock>|
|Fixed In Version:||Doc Type:||Bug Fix|
|Doc Text:||Story Points:||---|
|Last Closed:||2003-03-21 10:41:54 UTC||Type:||---|
|oVirt Team:||---||RHEL 7.3 requirements from Atomic Host:|
|Cloudforms Team:||---||Target Upstream Version:|
Description Keith Ansell 2003-03-21 10:11:44 UTC
Description of problem: Can you help, we have a database product that uses memory mapping to access and update the database file. On Linux the flushing deamon can not flush the modified memory until a munmap or msync is called. Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. A program that opens a file and map's the first 4k block. 2. Modify that memory block. 3. Crash the box after 30 seconds. Actual results: The disk file is not modified. Expected results: This disk file is modified. Additional info: Can I get bdflush deamon to detect and flush the dirty pages to disk? Is this a linux bug? The flushing deamon on the Unix operating system, flushes all write required pages to disk and that includes all those modified memory mapped pages, but linux doesn't.
Comment 1 Stephen Tweedie 2003-03-21 10:41:54 UTC
From my reading of the SingleUnix spec, we are not required to sync mmaps to disk unless there is an explicit msync or if the region is unmapped. This is not a bug. Please reopen if you can find an assertion to the contrary in the standard, but I think this is simply a portability issue --- any code that assumes it does not need to msync is just non-portable, as it is relying on implementation-specific behaviour.