btrfs-progs: Fix delayed ref leakage
Status from this message: Applied, thanks.
Get series with b4
b4 am [email protected]Versions newest first
Changes in v2 from the cover letter
- Use a loop to exhaust both delayed refs and dirty block groups Thanks Nikolay for pointing out the feedback between them.
- Add a new patch to reduce above feedback
- Handle the error from btrfs_write_dirty_block_groups()
Patches in v2 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | btrfs-progs: Exhaust delayed refs and dirty block groups to prevent delayed refs losttransaction.c | +21 | 2 replies | |
| 2/2 | btrfs-progs: Avoid unnecessary block group item COW if the content hasn't changedextent-tree.c | +25 | 5 replies |
Reviews trailers per patch
1 of 2 patches has a Reviewed-by or Acked-by.
| Patch | Nikolay Borisov |
|---|---|
| 1/2 | R-b |
| 2/2 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v2 0/2] btrfs-progs: Fix delayed ref leakage
We have several bug reports of btrfs-convert failure in btrfs_run_delayed_refs().
The bug turns out to be a incorrect backport of delayed ref handling in transaction commit.
In kernel we have a loop to exhause both delayed refs and dirty blocks, as btrfs_write_dirty_block_groups() can generate new delayed refs, while btrfs_run_delayed_refs() can re-dirty block groups.
This feedback could cause missing delayed refs, and bite later transaction just like the btrfs-convert report.
Furthermore, such lost delayed refs causes memory leakage and reserved space leakage, the later one can be detected by commit c31edf610cbe ("btrfs-progs: Fix false ENOSPC alert by tracking used space correctly").
The first patch will fix the long existing bug.
The second patch will try to reduce the feedback between btrfs_write_dirty_block_groups() and btrfs_run_delayed_refs().
Changelog:
v2:
- Use a loop to exhaust both delayed refs and dirty block groups Thanks Nikolay for pointing out the feedback between them.
- Add a new patch to reduce above feedback
- Handle the error from btrfs_write_dirty_block_groups()
Qu Wenruo (2):
btrfs-progs: Exhaust delayed refs and dirty block groups to prevent
delayed refs lost
btrfs-progs: Avoid unnecessary block group item COW if the content
hasn't changed
extent-tree.c | 26 +++++++++++++++++++++++++- transaction.c | 27 +++++++++++++++++++++------ 2 files changed, 46 insertions(+), 7 deletions(-)
Signature · 1 line
2.22.0