Dataloss on NFS-clients who modify an mmap()'d area after closing the file-descriptor

Solution Verified - Updated -

Issue

When an application on an NFS-client (tested with NFSv3) executes the following steps, data written after the close() is never flushed to the server:

  1. open()
  2. mmap()
  3. close()
  4. <modify data in the mmap'ed area>
  5. munmap()

Dropping the caches (via /proc/sys/vm/drop_caches) or unmounting does not result in the data being sent to the server.

The man-page for mmap() (man 2 mmap) does mention that closing the file-descriptor does not munmap() the area. Using the mmap'ed area after a close() seems valid (although it is bad practice).

Environment

  • Red Hat Enterprise Linux 5.8

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content