From: Nick Piggin <nickpiggin@yahoo.com.au>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Alan Stern <stern@rowland.harvard.edu>,
linux-kernel@vger.kernel.org, ospite@studenti.unina.it,
Matthew Wilcox <matthew@wil.cx>
Subject: Re: BUG in VFS or block layer
Date: Thu, 7 Aug 2008 12:12:58 +1000 [thread overview]
Message-ID: <200808071212.58506.nickpiggin@yahoo.com.au> (raw)
In-Reply-To: <20080806142805.9db6f52f.akpm@linux-foundation.org>
On Thursday 07 August 2008 07:28, Andrew Morton wrote:
[...]
I'll have a go at reproducing it if I can.
> Aside: why does this code in do_generic_file_read() return -EIO when it
> got a signal?
>
>
> page_not_up_to_date:
> /* Get exclusive access to the page ... */
> if (lock_page_killable(page))
> goto readpage_eio;
I wondered about that too, but the error never gets back to userspace, so
we just want something that is going to return quickly.
> One possible problem is here:
>
> readpage:
> /* Start the actual read. The read will unlock the page. */
> error = mapping->a_ops->readpage(filp, page);
>
> if (unlikely(error)) {
> if (error == AOP_TRUNCATED_PAGE) {
> page_cache_release(page);
> goto find_page;
> }
> goto readpage_error;
> }
>
> the VFS layer assumes that if ->readpage() returned a synchronous error
> then the page was already unlocked within ->readpage(). Usually this
> means that the driver layer had to run the BIO completion callback to
> do that unlocking. It is possible that the USB code forgot to do this.
> This would explain what you're seeing.
>
> So... would you be able to verify that the USB, layer is correctly
> calling bio->bi_end_io() for the offending requests?
That seems likely.
> Aside2: why does this code:
>
> readpage:
> /* Start the actual read. The read will unlock the page. */
> error = mapping->a_ops->readpage(filp, page);
>
> if (unlikely(error)) {
> if (error == AOP_TRUNCATED_PAGE) {
> page_cache_release(page);
> goto find_page;
> }
> goto readpage_error;
> }
>
> if (!PageUptodate(page)) {
> if (lock_page_killable(page))
> goto readpage_eio;
>
> return EIO if lock_page_killable() saw a signal?
Same as above.
prev parent reply other threads:[~2008-08-07 2:13 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-06 20:40 Alan Stern
2008-08-06 21:28 ` Andrew Morton
2008-08-06 22:40 ` Alan Stern
2008-08-06 22:55 ` Andrew Morton
2008-08-07 14:17 ` Alan Stern
2008-08-07 2:12 ` Nick Piggin [this message]
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=200808071212.58506.nickpiggin@yahoo.com.au \
--to=nickpiggin@yahoo.com.au \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=matthew@wil.cx \
--cc=ospite@studenti.unina.it \
--cc=stern@rowland.harvard.edu \
/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
all inboxes | Powered by JetHome®