linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: fdmanana@kernel.org
To: linux-btrfs@vger.kernel.org
Subject: [PATCH 0/4] btrfs: some readhead fixes after removing or replacing a device
Date: Mon, 12 Oct 2020 11:55:22 +0100	[thread overview]
Message-ID: <cover.1602499587.git.fdmanana@suse.com> (raw)

From: Filipe Manana <fdmanana@suse.com>

This patchset fixes use-after-free bugs and a hang after a device is removed
or replaced. The hang only happens if a device replace happens while a scrub
is running (on a device other then the source device of the replace operation),
while the use-after-free bugs can happen without scrub involved.

The two first patches are the actual bug fixes, while the third patch just
adds a lockdep assertion and the fourth and last patch just makes scrub not
trigger readahead of the csums tree when it's not needed.

Filipe Manana (4):
  btrfs: fix use-after-free on readahead extent after failure to create
    it
  btrfs: fix readahead hang and use-after-free after removing a device
  btrfs: assert we are holding the reada_lock when releasing a readahead
    zone
  btrfs: do not start readahead for csum tree when scrubbing non-data
    block groups

 fs/btrfs/ctree.h       |  2 ++
 fs/btrfs/dev-replace.c |  5 +++++
 fs/btrfs/reada.c       | 49 ++++++++++++++++++++++++++++++++++++++++++
 fs/btrfs/scrub.c       | 20 ++++++++++-------
 fs/btrfs/volumes.c     |  3 +++
 fs/btrfs/volumes.h     |  1 +
 6 files changed, 72 insertions(+), 8 deletions(-)

-- 
2.28.0


             reply	other threads:[~2020-10-12 10:55 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-12 10:55 fdmanana [this message]
2020-10-12 10:55 ` [PATCH 1/4] btrfs: fix use-after-free on readahead extent after failure to create it fdmanana
2020-10-13  8:59   ` Johannes Thumshirn
2020-10-13 14:16   ` Josef Bacik
2020-10-12 10:55 ` [PATCH 2/4] btrfs: fix readahead hang and use-after-free after removing a device fdmanana
2020-10-13 14:39   ` Josef Bacik
2020-10-12 10:55 ` [PATCH 3/4] btrfs: assert we are holding the reada_lock when releasing a readahead zone fdmanana
2020-10-13  9:07   ` Johannes Thumshirn
2020-10-13  9:15     ` Filipe Manana
2020-10-13  9:22       ` Johannes Thumshirn
2020-10-13  9:25         ` Johannes Thumshirn
2020-10-13  9:26   ` Johannes Thumshirn
2020-10-13 14:40   ` Josef Bacik
2020-10-12 10:55 ` [PATCH 4/4] btrfs: do not start readahead for csum tree when scrubbing non-data block groups fdmanana
2020-10-12 12:46   ` Nikolay Borisov
2020-10-13  9:13   ` Johannes Thumshirn
2020-10-13 14:41   ` Josef Bacik
2020-10-19 16:51 ` [PATCH 0/4] btrfs: some readhead fixes after removing or replacing a device David Sterba

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=cover.1602499587.git.fdmanana@suse.com \
    --to=fdmanana@kernel.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).