From: Nick Piggin <nickpiggin@yahoo.com.au>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Eric Van Hensbergen <ericvh@gmail.com>,
linux-kernel@vger.kernel.org,
v9fs-developer@lists.sourceforge.net
Subject: Re: [RESEND][PATCH] 9p: add write-cache support to loose cache mode
Date: Wed, 14 Feb 2007 14:05:44 +1100 [thread overview]
Message-ID: <45D27C88.5030605@yahoo.com.au> (raw)
In-Reply-To: <20070213181155.f7eebd83.akpm@linux-foundation.org>
Andrew Morton wrote:
>>On Tue, 13 Feb 2007 20:07:44 -0600 "Eric Van Hensbergen" <ericvh@gmail.com> wrote:
>>On 2/13/07, Andrew Morton <akpm@linux-foundation.org> wrote:
>>
>>>>On Tue, 13 Feb 2007 17:55:31 -0600 Eric Van Hensbergen <ericvh@gmail.com> wrote:
>>>>+int v9fs_prepare_write(struct file *file, struct page *page,
>>>>+ unsigned from, unsigned to)
>>>>+{
>>>>+ if (!PageUptodate(page)) {
>>>>+ if (to - from != PAGE_CACHE_SIZE) {
>>>>+ void *kaddr = kmap_atomic(page, KM_USER0);
>>>>+ memset(kaddr, 0, from);
>>>>+ memset(kaddr + to, 0, PAGE_CACHE_SIZE - to);
>>>>+ flush_dcache_page(page);
>>>>+ kunmap_atomic(kaddr, KM_USER0);
>>>>+ }
>>>>+ SetPageUptodate(page);
>>>>+ }
>>>
>>>This will mark the page uptodate while the piece between `to' and `from' is
>>>uninitialised. A concurrent pagefault can come in and permit a read of
>>>that uninitialised data. Because filemap_nopage() doesn't lock the page if
>>>it is uptodate.
>>>
>>
>>Okay - I snagged this code from fs/libfs.c (simple_prepare_write) --
>>is that code also not correct, or am I just using it in the wrong
>>context?
>>
>
>
> libfs.c is wrong. Nick has fixes, but they got tangled up in other stuff.
Yeah. 1/9 in that series should be applied on its own and sent upstream.
Need me to resend?
--
SUSE Labs, Novell Inc.
Send instant messages to your online friends http://au.messenger.yahoo.com
next prev parent reply other threads:[~2007-02-14 3:06 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-13 23:55 [RESEND][PATCH] 9p: add write-cache support to loose cache mode Eric Van Hensbergen
2007-02-14 0:16 ` Andrew Morton
2007-02-14 2:07 ` Eric Van Hensbergen
2007-02-14 2:11 ` Andrew Morton
2007-02-14 3:05 ` Nick Piggin [this message]
2007-02-14 3:10 ` Andrew Morton
2007-02-14 0:26 ` Andrew Morton
2007-02-14 0:27 ` Andrew Morton
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=45D27C88.5030605@yahoo.com.au \
--to=nickpiggin@yahoo.com.au \
--cc=akpm@linux-foundation.org \
--cc=ericvh@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=v9fs-developer@lists.sourceforge.net \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.