Skip to content

btrfs: raid56: minor fixes to rmw_rbio()

Qu Wenruo linux-btrfs 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2btrfs: fix racy bio_list changes for failed RMW rbiofs/btrfs/raid56.c+20 -120 replies
2/2btrfs: don't cache rbio if an error is hitfs/btrfs/raid56.c+3 -00 replies

Reviews trailers per patch

None of the 2 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchFilipe Manana
SeriesR-b
1/2
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/2] btrfs: raid56: minor fixes to rmw_rbio()

I was checking the bio_list_lock usage as some call sites doesn't look sane, e.g. spin_lock(); set_bit(); spin_unlock();.

But during the cleanup and reviewing, LLM exposed two new bugs:

- rbio_orig_end_io() can race with lock_stripe_add()
And rbio_orig_end_io() didn't hold the bio_list_lock, under certain race condition, a bio can even be missing.

Fixed by the first patch.

- Failed rbio can still be cached
Fixed by the second patch.

Qu Wenruo (2):
btrfs: fix racy bio_list changes for failed RMW rbio
btrfs: don't cache rbio if an error is hit

 fs/btrfs/raid56.c | 35 +++++++++++++++++++++++------------
 1 file changed, 23 insertions(+), 12 deletions(-)
Signature · 1 line
2.56.0