Skip to content

btrfs: fixes for the 13 subpage preparation patches

Qu Wenruo linux-btrfs 3 versions In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest2 patches 2 repliesIn review
  2. v22 patches 0 repliesSuperseded
  3. v12 patches 0 repliesSuperseded

Changes in v3 from the cover letter

- Change the fix for the btrfs/215 hang
Now we choose to skip the locked page, leaving both its Ordered bit and ordered extent accounting to be handled by run_delalloc_range() error hanlding path.

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2btrfs: fix the fs hang when run_delalloc_range() failedfs/btrfs/inode.c+21 -00 replies
2/2btrfs: fix the unsafe access in btrfs_lookup_first_ordered_range()fs/btrfs/ordered-data.c+2 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCH v3 0/2] btrfs: fixes for the 13 subpage preparation patches

Although Ritesh and Goldwyn were both testing full subpage patches and got pretty good results, our awesome maintainer David still found some crash and hang:

- btrfs/125 hang on x86
This test case is not in auto group, and for subpage case we reject RAID56 thus it doesn't trigger the hang.

It's a behavior change in page Ordered (private2) cleanup sequence. In btrfs_cleanup_ordered_extents() we cleaned up the page Ordered bit, but doesn't run the ordered extent accounting for the locked page. This leaves the ordered extent accounting never run on the locked page, hanging the fs.

This needs a dedicated fix, but it's still pretty small (mostly comments), and won't affect normal routines.

- generic/521 random crash on x86
Which I can't reproduce, but according to the dying message, it's not hard to find the problem.
An assignment out of the protection of spinlock.
This small fix can be folded into patch "btrfs: introduce btrfs_lookup_first_ordered_range()"

Changelog:
v2:
- Fix the typos in the commit message of the 1st patch
- Remove the ClearPageOrdered() call in the 1st patch
As btrfs_mark_ordered_io_finished() will clear it in a more accurate way.
And ClearPageOrdered() is not subpage compatible.

v3:
- Change the fix for the btrfs/215 hang
Now we choose to skip the locked page, leaving both its Ordered bit and ordered extent accounting to be handled by run_delalloc_range() error hanlding path.

This fixes a possible ordered extent underflow, and removes a forward declaration.

Qu Wenruo (2):
btrfs: fix the fs hang when run_delalloc_range() failed
btrfs: fix the unsafe access in btrfs_lookup_first_ordered_range()

 fs/btrfs/inode.c        | 21 +++++++++++++++++++++
 fs/btrfs/ordered-data.c |  3 ++-
 2 files changed, 23 insertions(+), 1 deletion(-)
Signature · 1 line
2.31.1