lkml.org 
[lkml]   [2002]   [Jul]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectMemory mapped files on NFS mounted drives
Date
Hello,

OS/Kernel checked:
===============
RH 7.2 (kernel 2.4.7-10) and RH 7.3 (kernel 2.4.18-3) (I haven't checked the
others).

Problem description:
===============
I attempt to read/write memory mapped file from two Linux machines, which
resides on NFS mounted drive. The file gets corrupted since the changes made
on one machine aren't immediately available on the other. The sample program
is attached to this e-mail - simply run and play with it on NFS mounted
drive to make sure there is some inconsistency.
The problematic API set includes (mmap, munmap and msync system calls).

The original code uses NFS locking to assure file consistency, but the
example misses this part to simplicity (locking is simulated by the user).
The same code works on a variety of other operating systems, but fails to
work between two Linux or Linux/Other OS machines.

Known workarounds/patches:
======================
I decided to give up on the performance issue and even tried to remap the
whole file before every attempt to read/write the mapped file. Surprisingly,
even this extreme measure didn't help (the code is commented out using
preprocessor directives in the sample program).
I couldn't find any patch, which specifically fixes this problem, though I
have seen some patches related to msync, which I don't think to be relevant
(Am I wrong?).


I'm sure that someone has come across this problem and I sure hope there is
some workaround/patch available.
Any help will be greatly appreciated.

Thanks in advance.
Giga

<<mmap.cc>>
[unhandled content-type:application/octet-stream]
\
 
 \ /
  Last update: 2005-03-22 13:22    [W:0.029 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site