btrfs: fix data corruption/rsv leak in subpage zoned cases
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v3 Latest2 patches 1 replyIn review
- v22 patches 3 repliesSuperseded
- v12 patches 0 repliesSuperseded
Changes in v3 from the cover letter
- Use the minimal fsstress workload with trace_printk() output to explain the bug better
Patches in v3 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | btrfs: do not clear page dirty inside extent_write_locked_range()fs/ | +1 | 0 replies | |
| 2/2 | btrfs: make extent_write_locked_range() to handle subpage writeback correctlyfs/ | +4 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.
Cover letter [PATCH v3 0/2] btrfs: fix data corruption/rsv leak in subpage zoned cases
[CHANGELOG]
v3:
- Use the minimal fsstress workload with trace_printk() output to explain the bug better
v2:
- Update the commit message for the first patch
As there is something wrong with the ASCII art of the memory layout.
[REPO]
https://github.com/adam900710/linux/tree/subpage_delalloc
The repo includes the subpage delalloc rework, or subpage zoned won't work at all.
Although my previous subpage delalloc rework fixes quite a lot of crashes of subpage + zoned support, it's still pretty easy to cause rsv leak using single thread fsstress.
It turns out that, it's not a simple problem of some rsv leak, but certain dirty data ranges never got written back and just skipped with its dirty flags cleared, no wonder that would lead to rsv leak.
The root cause is again in the extent_write_locked_range() function doing weird subpage incompatible behaviors, especially when it clears the page dirty flag for the whole page, causing __extent_writepage_io() unable to locate further dirty ranges to be submitted.
The first patch would solve the problem, meanwhile for the 2nd patch it's a cleanup, as we will never hit the error for current subpage + zoned cases.
Qu Wenruo (2):
btrfs: do not clear page dirty inside extent_write_locked_range()
btrfs: make extent_write_locked_range() to handle subpage writeback
correctly
fs/btrfs/extent_io.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
Signature · 1 line
2.44.0