Bug 147969 - msync(..., ..., MS_SYNC) returning before data written to disk
msync(..., ..., MS_SYNC) returning before data written to disk
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: kernel (Show other bugs)
3.0
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Larry Woodman
Brian Brock
: Regression
Depends On:
Blocks: 132991
  Show dependency treegraph
 
Reported: 2005-02-14 04:33 EST by Chris Richards
Modified: 2010-10-21 22:47 EDT (History)
11 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-04-22 16:17:34 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Chris Richards 2005-02-14 04:33:45 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (compatible; Konqueror/3.2) (KHTML, like Gecko)

Description of problem:
Calling msync(p, size, MS_SYNC) on a memory mapped file is not waiting for the data to be flushed to disk [eg a 128Mb chunk of data is claiming to be flushed in 1-2ms : cf 2.4.21-15 / 2.6.8-1.521 where the same test code takes 2-3s to do this]

This means that there is no way for code to know that the data it has just written to a memory mapped file has actually made it to disk.

Version-Release number of selected component (if applicable):
kernel-2.4.21-20.EL and kernel-2.4.21-27.0.2.EL

How reproducible:
Always

Steps to Reproduce:
1.mmap a (large-ish) file
2.write some data into the memory region
3.call msync with the MS_SYNC option
4.reboot the PC by hitting the power switch once msync has completed... [or time how long it takes to sync the data]
5.look at the contents of the file
    

Actual Results:  Data missing from file on disk (was present in file (ie disk buffers) prior to hitting power)

Expected Results:  msync should wait for the data to be written to disk when the MS_SYNC flag is used.

Additional info:
Comment 2 Chris Richards 2005-02-16 12:41:03 EST
linux-2.4.21-mmap-updates.patch lines 193/4 seem to be the problem.  
Upper limit test on end >= vma->vm_end fails when you sync the whole 
memory mapped area, but returns error (==0 ==success) so that you 
have no idea that it hasn't sync'ed anything at all. 
Comment 7 Larry Woodman 2005-02-17 09:20:14 EST
The patch to fix this problem was sent to rhkernel-list and has recieved the
nexessary ACKs for inclusion in RHEL3-U5.

Larry Woodman
Comment 8 Ernie Petrides 2005-02-19 05:23:21 EST
A fix for this problem has just been committed to the RHEL3 U5
patch pool this evening (in kernel version 2.4.21-27.16.EL).
Comment 9 Ernie Petrides 2005-04-16 18:31:45 EDT
A fix for this problem has also been committed to the RHEL3 E5
patch pool this afternoon (in kernel version 2.4.21-27.0.4.EL).
Comment 10 Josh Bressers 2005-04-22 16:17:35 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2005-293.html
Comment 11 Tim Powers 2005-05-18 09:29:17 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2005-294.html

Note You need to log in before you can comment on or make changes to this bug.