🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #57144

Re: CNFS corruption

#57144
From: Russ Allbery
Date: Fri, 08 Mar 2002 22:53
38 lines
2836 bytes
BOUWSMA Beery <netbsd-misuser-200202@dcf77-zeit.netscum.dyndns.dk> writes:

> And looking further into storage/cnfs/cnfs.c,v it seems that the msync()
> calls there also disappeared months ago, along with any references to
> MMAP_NEEDS_MSYNC and MMAP_MISSES_WRITES and the like.  So while the
> `configure' process may define these for NetBSD (I can't remember), I'm
> not sure if the k0deZ make the proper use of these nowadays.

In CURRENT, they were all replaced with calls to functions that are now
defined in portable/mmap.h:

/* Some platforms don't flush data written to a memory mapped region until
   msync or munmap; on those platforms, we sometimes need to force an msync
   so that other parts of INN will see the changed data.  Some other
   platforms don't see writes to a file that's memory-mapped until the
   memory mappings have been flushed.

   These platforms can use mmap_flush to schedule a flush to disk and
   mmap_invalidate to force re-reading from disk.  Note that all platforms
   should still periodically call msync so that data is written out in case
   of a crash. */
#if MMAP_NEEDS_MSYNC
# define mmap_flush(p, l)       msync((p), (l), MS_ASYNC)
#else
# define mmap_flush(p, l)       /* empty */
#endif
#if MMAP_MISSES_WRITES
# define mmap_invalidate(p, l)  msync((p), (l), MS_INVALIDATE)
#else
# define mmap_invalidate(p, l)  /* empty */
#endif

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>

          Please post questions rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Technical Details
Message-ID: <yllmd23c40.fsf@windlord.stanford.edu>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!nntp.stanford.edu!not-for-mail
References: <slrna7df2u.a4s.br@panix2.panix.com> <0000001110.r00tshell@news.radio.cz> <v1Ad8.169610$Re2.12738727@bin6.nnrp.aus1.giganews.com> <a56k5u$jqp$1@panix3.panix.com> <ylr8ndw0fu.fsf@windlord.stanford.edu> <m3u1s1eyqs.fsf@pyrophore.ogoense.net> <0000010011.r00tshell@news.radio.cz>

Show Full Headers
Complete Article Headers
Message-ID: <yllmd23c40.fsf@windlord.stanford.edu>
Subject: Re: CNFS corruption
Date: Fri, 08 Mar 2002 14:53:35 -0800
From: Russ Allbery <rra@stanford.edu>
References: <slrna7df2u.a4s.br@panix2.panix.com> <0000001110.r00tshell@news.radio.cz> <v1Ad8.169610$Re2.12738727@bin6.nnrp.aus1.giganews.com> <a56k5u$jqp$1@panix3.panix.com> <ylr8ndw0fu.fsf@windlord.stanford.edu> <m3u1s1eyqs.fsf@pyrophore.ogoense.net> <0000010011.r00tshell@news.radio.cz>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!nntp.stanford.edu!not-for-mail
Newsgroups: news.software.nntp
Organization: The Eyrie
Lines: 37
NNTP-Posting-Host: windlord.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: news.Stanford.EDU 1015628016 23789 171.64.13.23 (8 Mar 2002 22:53:36 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Gnus/5.090005 (Oort Gnus v0.05) XEmacs/21.4 (Common Lisp,
 sparc-sun-solaris2.6)
Cancel-Lock: sha1:dWdNvKB4s1BRBKA7VeDNE+cOpq0=