Skip to content

btrfs-progs: Handle error properly in btrfs_commit_transaction()

Qu Wenruo linux-btrfs 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3btrfs-progs: Remove the dead branch in btrfs_run_delayed_refs()extent-tree.c+0 -21 reply
2/3btrfs-progs: Refactor btrfs_finish_extent_commit()ctree.h extent-tree.c transaction.c+8 -131 reply
3/3btrfs-progs: Handle error properly in btrfs_commit_transaction()delayed-ref.c delayed-ref.h extent-tree.c +1 more+46 -91 reply

Reviews trailers per patch

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

PatchNikolay Borisov
1/3R-b
2/3R-b
3/3R-b

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/3] btrfs-progs: Handle error properly in btrfs_commit_transaction()

This patchset can be fetched from github:
https://github.com/adam900710/btrfs-progs/tree/commit_failure_cleanup

This patchset will address the BUG_ON() triggered in fuzz-tests/003 and fuzz-tests/009.

For proper error handling in btrfs_commit_transaction(), we need a way to clean up per-transaction data properly.

Currently we only have delayed refs which are per-transaction, so introduce a new function, btrfs_destroy_delayed_refs() to cleanup delayed refs.

Now btrfs_commit_transaction() can error out gracefully with proper cleanup.

Patch 1 and 2 are just some minor cleanups found when crafting the 3rd patch.

Qu Wenruo (3):
btrfs-progs: Remove the dead branch in btrfs_run_delayed_refs()
btrfs-progs: Refactor btrfs_finish_extent_commit()
btrfs-progs: Handle error properly in btrfs_commit_transaction()

 ctree.h       |  4 +---
 delayed-ref.c | 24 ++++++++++++++++++++++++
 delayed-ref.h |  5 +++++
 extent-tree.c | 22 +++++++++-------------
 transaction.c | 23 +++++++++++++++--------
 5 files changed, 54 insertions(+), 24 deletions(-)
Signature · 1 line
2.21.0