Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 13 Apr 2023 00:23:18 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 270810] munmap does not always sync the underlying file
Message-ID:  <bug-270810-227@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D270810

            Bug ID: 270810
           Summary: munmap does not always sync the underlying file
           Product: Base System
           Version: 13.1-RELEASE
          Hardware: amd64
                OS: Any
            Status: New
          Severity: Affects Many People
          Priority: ---
         Component: kern
          Assignee: bugs@FreeBSD.org
          Reporter: geoffrey@dommett.com

the man page explicitly states that The msync() system call is usually not
needed

however when doing the following sequence
open()=20
mmap()
close()=20
do something that writes to the memory mapped region
munmap()

program exits immediately, the underlying file is not reliably updated when=
 on
an nfs mount. Random pages are not written. Calling msync before unmapping
solves this, but the man pages do not indicate that this is necessary. The
problem does not seem to occur if the program performs more IO after the mu=
nmap
before exiting. The problem never occurs when the mapped file is on a local
file system.

nfs server of this test was running FreeBSD 12.1-RELEASE-p3
nfs clients tested FreeBSD 12.1-RELEASE-p3 and FreeBSD 13.1-RELEASE-p2

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-270810-227>