Article View: news.software.nntp
Article #46878Re: ReiserFS and news
From: Florian Weimer
Date: Fri, 09 Jun 2000 00:00
Date: Fri, 09 Jun 2000 00:00
48 lines
3268 bytes
3268 bytes
Russ Allbery <rra@stanford.edu> writes:
> There's some sort of odd problem with ReiserFS and INN when the active
> file is on a ReiserFS file system (and possibly with overview that's
> mmap'd; I'm not sure). Something about how INN uses mmap and how ReiserFS
> supports it doesn't entirely get along, and I've never been able to track
> down the details (not having access to ReiserFS myself).
When mmap()ing the active file, INN assumes that a NUL character
follows the actual file data (by mapping one more byte than the file
contains, see nnrpd/group.c in INN 2.2.2). When the size of the
active file is an integral multiple of the page size of the system,
accessing the byte beyond the end of the actual file might result in
a SIGSEGV (at least POSIX permits this behavior, and it's enforced by
very recent Linux kernels, I think). Earlier comments from me on this
subject were probably wrong.
> The ReiserFS folks claim that it's a bug in INN, which is quite
> possible,
The INN approach mentioned above is perhaps problematic. Linux mmap()
used to behave as required by INN, and I once believed that other
implementations do as well, but Alan Cox says it's a linuxism that you
can mmap() more bytes than there are in a file to get additional zero
bytes.
> but they've never given us a real bug report so I don't know where
> to look to try to fix it.
ReiserFS sometimes writes junk to the last block on disk after the end
of the file. It looks like this:
| |
FILE DATA FILE DATA FILE DATA | SOME RANDOM GARBAGE |
| |
^ ^
| |
End of file -/ End of disk block -/
If you read data using read(), the read operation stops at the end
of the file. But if you use mmap(), integral blocks are mapped to
memory, and the garbage is suddenly visible. Actually, mmap() is
correct here (it's implemented this way on most of the file systems, I
think), but the garbage should never have been written to disk.
Technical Details
Message-ID:
<87u2f2oddl.fsf@deneb.cygnus.argh.org>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!not-for-mailReferences:
<393F52CC.9FA1B9D6@int.tele.dk> <1rn1kwxq76.fsf@haey.ifi.uio.no> <8homi7$2vpt$1@mired.zark.thedonkeys.org> <yl8zwf7rr1.fsf@windlord.stanford.edu>Show Full Headers
Complete Article Headers
Message-ID: <87u2f2oddl.fsf@deneb.cygnus.argh.org> Subject: Re: ReiserFS and news Date: Fri, 09 Jun 2000 00:00:00 +0000 From: Florian Weimer <fw@deneb.cygnus.argh.org> References: <393F52CC.9FA1B9D6@int.tele.dk> <1rn1kwxq76.fsf@haey.ifi.uio.no> <8homi7$2vpt$1@mired.zark.thedonkeys.org> <yl8zwf7rr1.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!not-for-mail X-Deja-AN: 633173238 Mail-Copies-To: never Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@cygnus.argh.org X-Trace: deneb.cygnus.argh.org 960579398 16397 192.168.1.2 (9 Jun 2000 19:36:38 GMT) Organization: Penguin on board User-Agent: Gnus/5.0807 (Gnus v5.8.7) Emacs/20.6 Mime-Version: 1.0 Reply-To: Florian Weimer <fw-usenet@deneb.cygnus.argh.org> NNTP-Posting-Date: 9 Jun 2000 19:36:38 GMT Newsgroups: news.software.nntp