linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: linux-btrfs@vger.kernel.org
Subject: Missing unread page handling in readpages
Date: Fri, 14 Feb 2020 21:15:54 -0800	[thread overview]
Message-ID: <20200215051554.GF7778@bombadil.infradead.org> (raw)


As part of my rewrite of the readahead code, I think I spotted a hole
in btrfs' handling of errors in the current readpages code.

btrfs_readpages() calls extent_readpages() calls (a number of things)
then finishes up by calling submit_one_bio().  If submit_one_bio()
returns an error, I believe btrfs never unlocks the pages which were in
that bio.  Certainly the VFS does not; the filesystem is presumed to
unlock those pages when IO finishes.  But AFAICT, returning an error
there means btrfs will never start IO on those pages submit_one_bio()
is a btrfs function.  It calls tree->ops->submit_bio_hook() so that's
either btree_submit_bio_hook() or btrfs_submit_bio_hook(), which certainly
seem like they might be able to return errors.

So do we need to do something to complete the bio with an error in
order to unlock those pages?  Or have I failed to notice that already
happening somewhere?


             reply	other threads:[~2020-02-15  5:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-15  5:15 Matthew Wilcox [this message]
2020-02-15 11:16 ` Missing unread page handling in readpages Filipe Manana
2020-02-15 16:48   ` Matthew Wilcox

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=20200215051554.GF7778@bombadil.infradead.org \
    --to=willy@infradead.org \
    --cc=linux-btrfs@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;
as well as URLs for NNTP newsgroup(s).