Date: Tue, 22 Nov 2005 01:45:59 -0600 From: Dan Nelson <dnelson@allantgroup.com> To: Mikhail Teterin <mi+mx@aldan.algebra.com> Cc: questions@freebsd.org Subject: Re: some files written via mmap end up corrupted Message-ID: <20051122074559.GA6893@dan.emsphone.com> In-Reply-To: <200511211650.08260.mi%2Bmx@aldan.algebra.com> References: <200511211650.08260.mi%2Bmx@aldan.algebra.com>
next in thread | previous in thread | raw e-mail | index | archive | help
In the last episode (Nov 21), Mikhail Teterin said: > I must not be using the API properly :-( > > The writes to the mmap-ed area and then fsync-s the opened file, > munmaps it, and exits. > > Sometimes, the files end up corrupted at the end, however -- in about > 10% of cases. What kind of corruption are you seeing? Blocks of zeroes? Maybe you need to call msync() before unmapping the region? Or call munmap before fsync. > What am I doing wrong? Thanks! Can't tell that for sure without seeing the code :) -- Dan Nelson dnelson@allantgroup.com
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20051122074559.GA6893>