From: Al Viro <viro@parcelfarce.linux.theplanet.co.uk>
To: James Washer <washer@us.ibm.com>
Cc: linux-kernel@vger.kernel.org, washer@beaverton.ibm.com
Subject: Re: CONFIRMED bug in do_generic_file_read
Date: Fri, 13 May 2005 16:17:44 +0100 [thread overview]
Message-ID: <20050513151744.GH1150@parcelfarce.linux.theplanet.co.uk> (raw)
In-Reply-To: <OFF1B70B69.DFDD4B59-ON88257000.004A3F64-88257000.004B2949@us.ibm.com>
On Fri, May 13, 2005 at 06:42:50AM -0700, James Washer wrote:
> Al, relax.. as I said, I don't know much about page cache code.
>
> So, let me ask a question, if I can, with out upsetting you further.
>
> You say the analysis is, ah, incorrect.
>
> Can you help me understand what a readpage routine SHOULD do with a page
> when it finds it cannot "arrange" a successful read? Is simply returning
> an error incorrect behaviour? If so, what should the readpage do?
It is a perfectly acceptable behaviour. And it works just fine - e.g.
nfs_readpage() does that in quite a few cases.
What you are missing is the fact that page_cache_release() frees the
page only when it drops the final reference. And pages are pinned
down while they are in page cache.
If you see page_cache_release() right after ->readpage() triggering that
check, you've got out of ->readpage() with
* only one reference to page remaining
* one reference to that page acquired earlier in do_generic_file_read()
and not dropped until now.
* one reference to that page acquired back when it had been put
in page cache. Matching page_cache_release() would be done when page
is removed from page cache, but places that do it would remove the page
from cache first. Which would set ->mapping to NULL.
Conclusion: something had done an unbalanced page_cache_release(). That
happened after the moment when do_generic_file_read() had found the page
and pinned it down and before the end of ->readpage(). Most likely -
->readpage() itself or something called by it.
the page, but
next prev parent reply other threads:[~2005-05-13 15:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-05-13 0:57 CONFIRMED bug in do_generic_file_read Jim Washer
2005-05-13 7:57 ` Al Viro
[not found] ` <OFF1B70B69.DFDD4B59-ON88257000.004A3F64-88257000.004B2949@us.ibm.com>
2005-05-13 15:17 ` Al Viro [this message]
[not found] ` <OF77CCCDF4.63E93C67-ON88257000.0060D4EE-88257000.006248F5@us.ibm.com>
2005-05-13 18:20 ` Al Viro
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=20050513151744.GH1150@parcelfarce.linux.theplanet.co.uk \
--to=viro@parcelfarce.linux.theplanet.co.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=washer@beaverton.ibm.com \
--cc=washer@us.ibm.com \
/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