From: Andrea Arcangeli <andrea@novell.com>
To: linux-kernel@vger.kernel.org
Cc: Andrew Morton <akpm@osdl.org>, an.li.wang@intel.com
Subject: truncate shows non zero data beyond the end of the inode with MAP_SHARED
Date: Wed, 15 Sep 2004 14:29:20 +0200 [thread overview]
Message-ID: <20040915122920.GA4454@dualathlon.random> (raw)
Hello,
I've been told we're not posix compliant the way we handle MAP_SHARED
on the last page of the inode. Basically after we map the page into
userspace people can make the data beyond the i_size non-zero and we
should clear it in the transition from page_mapcount 1 -> 0. The bug
is that if you truncate-extend, the new data will not be guaranteed to
be zero.
msync + power outage and writing to the page with sys_write at the same
time it's being mapped (and in turn queueing it for pdflush writeout)
are the two worst offeners. To fix those we'd need to mark the pte
readonly, flush the tlb with a worst-case IPI broadcast, writepage, then
mark the pte read-write and flush the tlb again with another IPI
broadcast.
That is going to have a significant cost methinks. So maybe we shouldn't
fix it after all...
next reply other threads:[~2004-09-15 12:31 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-09-15 12:29 Andrea Arcangeli [this message]
2004-09-15 12:46 ` truncate shows non zero data beyond the end of the inode with MAP_SHARED Alan Cox
2004-09-15 21:01 ` William Lee Irwin III
2004-09-15 21:55 ` Andrew Morton
2004-09-15 22:00 ` William Lee Irwin III
2004-09-15 22:08 ` Andrea Arcangeli
2004-09-16 8:49 ` Helge Hafting
2004-09-16 14:26 ` Andrea Arcangeli
2004-09-17 13:49 ` Helge Hafting
2004-09-17 13:52 ` Andrea Arcangeli
2004-09-17 13:54 ` William Lee Irwin III
2004-09-15 22:04 ` Andrea Arcangeli
2004-09-15 21:58 ` Andrea Arcangeli
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040915122920.GA4454@dualathlon.random \
--to=andrea@novell.com \
--cc=akpm@osdl.org \
--cc=an.li.wang@intel.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox