public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Trond Myklebust <trond.myklebust@fys.uio.no>
To: Dmitry Monakhov <dmonakhov@openvz.org>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-nfs@vger.kernel.org
Subject: Re: [PATCH] nfs: clear_commit_release incorrectly handle truncated page
Date: Tue, 02 Feb 2010 10:36:39 -0500	[thread overview]
Message-ID: <1265124999.3177.27.camel@localhost> (raw)
In-Reply-To: <87eil3pszw.fsf@openvz.org>

On Tue, 2010-02-02 at 18:17 +0300, Dmitry Monakhov wrote: 
> Trond Myklebust <trond.myklebust@fys.uio.no> writes:
> 
> > On Tue, 2010-02-02 at 13:36 +0300, Dmitry Monakhov wrote: 
> >> After page was truncated it lost it's mapping, this result in null
> >> pointer dereference on bdi_stat update. In fact we have to decrement
> >> bdi_stat even for truncated pages, so let's pass correct mapping in
> >> function arguments. Patch against linux-2.6
> >> ##TEST_CASE
> >> /*
> >> Tast case for bug in nfs_clear_request_commit()
> >> caused by null pointer dereference in case of truncated page.
> >> It takes less than 10 minutes to reproduce the bug.
> >
> > Something is wrong here. nfs_release_page() returns '0' if the 
> > page has an associated write request (i.e. PagePrivate is set), and so
> > both invalidate_complete_page() and invalidate_complete_page2() will
> > fail.
> >
> > So what is truncating the page?
> truncate_inode_page()
>   truncate_complete_page()
>     if (page_has_private(page))
>        do_invalidatepage()
>          ->nfs_invalidate_page()

do_invalidate_page() is called before remove_from_page_cache(), so
page->mapping should still be set.

Trond


  reply	other threads:[~2010-02-02 15:36 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-02 10:36 [PATCH] nfs: clear_commit_release incorrectly handle truncated page Dmitry Monakhov
2010-02-02 15:04 ` Trond Myklebust
2010-02-02 15:17   ` Dmitry Monakhov
2010-02-02 15:36     ` Trond Myklebust [this message]
2010-02-02 15:56       ` Dmitry Monakhov
2010-02-02 16:17         ` Trond Myklebust
2010-02-02 16:47           ` Dmitry Monakhov
2010-02-02 17:00             ` Trond Myklebust
2010-02-02 17:09               ` Dmitry Monakhov
2010-02-02 19:54                 ` Trond Myklebust
2010-02-02 20:19                   ` Chuck Lever
2010-02-02 20:26                     ` Trond Myklebust

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=1265124999.3177.27.camel@localhost \
    --to=trond.myklebust@fys.uio.no \
    --cc=dmonakhov@openvz.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@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