Skip to content

btrfs: some readhead fixes after removing or replacing a device

[email protected] linux-btrfs 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 13 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4btrfs: fix use-after-free on readahead extent after failure to create itfs/btrfs/reada.c+2 -02 replies
2/4btrfs: fix readahead hang and use-after-free after removing a devicefs/btrfs/ctree.h fs/btrfs/dev-replace.c fs/btrfs/reada.c +2 more+56 -01 reply
3/4btrfs: assert we are holding the reada_lock when releasing a readahead zonefs/btrfs/reada.c+2 -06 replies
4/4btrfs: do not start readahead for csum tree when scrubbing non-data block groupsfs/btrfs/scrub.c+12 -83 replies

Reviews trailers per patch

All 4 patches have a Reviewed-by or Acked-by.

PatchNikolay BorisovJohannes ThumshirnJosef Bacik
1/4R-b R-b
2/4R-b
3/4R-b R-b
4/4R-b R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v1 thread

Cover letter [PATCH 0/4] btrfs: some readhead fixes after removing or replacing a device

From: Filipe Manana <[email protected]>

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(-)
Signature · 1 line
2.28.0