Skip to content

Error handling patchset v3

Jeff Mahoney linux-btrfs 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest65 patches 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/65btrfs: Add btrfs_panic()fs/btrfs/ctree.h fs/btrfs/super.c+60 -13 replies
2/65btrfs: Catch locking failures in {set,clear}_extent_bitfs/btrfs/extent_io.c+30 -110 replies
3/65btrfs: Panic on bad rbtree operationsfs/btrfs/ordered-data.c fs/btrfs/relocation.c+39 -90 replies
4/65btrfs: Simplify btrfs_insert_rootfs/btrfs/root-tree.c+3 -60 replies
5/65btrfs: set_extent_bit error push-upfs/btrfs/extent-tree.c fs/btrfs/extent_io.c fs/btrfs/file-item.c +3 more+70 -330 replies
6/65btrfs: lock_extent error push-upfs/btrfs/compression.c fs/btrfs/disk-io.c fs/btrfs/extent_io.c +5 more+94 -570 replies
7/65btrfs: clear_extent_bit error push-upfs/btrfs/disk-io.c fs/btrfs/extent-tree.c fs/btrfs/extent_io.c +7 more+108 -640 replies
8/65btrfs: unlock_extent error push-upfs/btrfs/compression.c fs/btrfs/disk-io.c fs/btrfs/extent_io.c +5 more+159 -1040 replies
9/65btrfs: pin_down_extent should return voidfs/btrfs/extent-tree.c+3 -40 replies
10/65btrfs: btrfs_pin_extent error push-upfs/btrfs/extent-tree.c fs/btrfs/tree-log.c+22 -80 replies
11/65btrfs: btrfs_drop_snapshot should return intfs/btrfs/ctree.h fs/btrfs/extent-tree.c+5 -50 replies
12/65btrfs: btrfs_start_transaction non-looped error push-upfs/btrfs/extent-tree.c fs/btrfs/relocation.c fs/btrfs/transaction.c +2 more+21 -80 replies
13/65btrfs: find_and_setup_root error push-upfs/btrfs/disk-io.c+2 -10 replies
14/65btrfs: btrfs_update_root error push-upfs/btrfs/root-tree.c+3 -10 replies
15/65btrfs: set_range_writeback should return voidfs/btrfs/extent_io.c+5 -30 replies
16/65btrfs: wait_on_state should return voidfs/btrfs/extent_io.c+2 -30 replies
17/65btrfs: wait_extent_bit should return voidfs/btrfs/extent_io.c fs/btrfs/extent_io.h+2 -30 replies
18/65btrfs: __unlock_for_delalloc should return voidfs/btrfs/extent_io.c+4 -50 replies
19/65btrfs: check_page_uptodate should return voidfs/btrfs/extent_io.c+1 -30 replies
20/65btrfs: check_page_locked should return voidfs/btrfs/extent_io.c+1 -30 replies
21/65btrfs: check_page_writeback should return voidfs/btrfs/extent_io.c+2 -30 replies
22/65btrfs: clear_extent_buffer_dirty should return voidfs/btrfs/extent_io.c fs/btrfs/extent_io.h+2 -30 replies
23/65btrfs: btrfs_cleanup_fs_uuids should return voidfs/btrfs/volumes.c fs/btrfs/volumes.h+2 -30 replies
24/65btrfs: run_scheduled_bios should return voidfs/btrfs/volumes.c+1 -20 replies
25/65btrfs: btrfs_close_extra_devices should return voidfs/btrfs/volumes.c fs/btrfs/volumes.h+2 -30 replies
26/65btrfs: schedule_bio should return voidfs/btrfs/volumes.c+1 -30 replies
27/65btrfs: fill_device_from_item should return voidfs/btrfs/volumes.c+1 -30 replies
28/65btrfs: btrfs_queue_worker should return voidfs/btrfs/async-thread.c fs/btrfs/async-thread.h+5 -110 replies
29/65btrfs: run_ordered_completions should return voidfs/btrfs/async-thread.c+2 -30 replies
30/65btrfs: btrfs_stop_workers should return voidfs/btrfs/async-thread.c fs/btrfs/async-thread.h+2 -30 replies
31/65btrfs: btrfs_requeue_work should return voidfs/btrfs/async-thread.c fs/btrfs/async-thread.h+3 -60 replies
32/65btrfs: tree-log: btrfs_end_log_trans should return voidfs/btrfs/tree-log.c fs/btrfs/tree-log.h+2 -30 replies
33/65btrfs: tree-log: wait_for_writer should return voidfs/btrfs/tree-log.c+2 -30 replies
34/65btrfs: btrfs_init_compress should return voidfs/btrfs/compression.c fs/btrfs/compression.h fs/btrfs/super.c+3 -70 replies
35/65btrfs: btrfs_invalidate_inodes should return voidfs/btrfs/ctree.h fs/btrfs/inode.c+2 -30 replies
36/65btrfs: __setup_root should return voidfs/btrfs/disk-io.c+4 -50 replies
37/65btrfs: btrfs_destroy_delalloc_inodes should return voidfs/btrfs/disk-io.c+2 -40 replies
38/65btrfs: btrfs_prepare_extent_commit should return voidfs/btrfs/ctree.h fs/btrfs/extent-tree.c+3 -40 replies
39/65btrfs: btrfs_set_block_group_rw should return voidfs/btrfs/ctree.h fs/btrfs/extent-tree.c+3 -40 replies
40/65btrfs: setup_inline_extent_backref should return voidfs/btrfs/extent-tree.c+11 -120 replies
41/65btrfs: btrfs_run_defrag_inodes should return voidfs/btrfs/ctree.h fs/btrfs/file.c+2 -30 replies
42/65btrfs: Simplify btrfs_submit_bio_hookfs/btrfs/inode.c+4 -30 replies
43/65btrfs: Factor out tree->ops->merge_bio_hook callfs/btrfs/extent_io.c fs/btrfs/inode.c+17 -50 replies
44/65btrfs: ->submit_bio_hook error push-upfs/btrfs/disk-io.c fs/btrfs/extent_io.c fs/btrfs/inode.c+26 -120 replies
45/65btrfs: __add_reloc_root error push-upfs/btrfs/relocation.c+15 -50 replies
46/65btrfs: fixup_low_keys should return voidfs/btrfs/ctree.c+11 -280 replies
47/65btrfs: setup_items_for_insert should return voidfs/btrfs/ctree.c fs/btrfs/ctree.h fs/btrfs/delayed-inode.c+16 -240 replies
48/65btrfs: del_ptr should return voidfs/btrfs/ctree.c+13 -260 replies
49/65btrfs: insert_ptr should return voidfs/btrfs/ctree.c+13 -330 replies
50/65btrfs: add_delayed_ref_head should return voidfs/btrfs/delayed-ref.c+10 -190 replies
51/65btrfs: add_delayed_tree_ref should return voidfs/btrfs/delayed-ref.c+6 -90 replies
52/65btrfs: add_delayed_data_ref should return voidfs/btrfs/delayed-ref.c+7 -100 replies
53/65btrfs: Fix kfree of member instead of structurefs/btrfs/delayed-ref.c+3 -30 replies
54/65btrfs: Use mempools for delayed refsfs/btrfs/delayed-ref.c fs/btrfs/delayed-ref.h fs/btrfs/super.c+107 -270 replies
55/65btrfs: Delayed ref mempool functions should return voidfs/btrfs/ctree.h fs/btrfs/delayed-ref.c fs/btrfs/delayed-ref.h +2 more+63 -800 replies
56/65btrfs: btrfs_inc_extent_ref void return prepfs/btrfs/file.c fs/btrfs/ioctl.c fs/btrfs/relocation.c +1 more+27 -370 replies
57/65btrfs: btrfs_free_extent void return prepfs/btrfs/extent-tree.c fs/btrfs/file.c fs/btrfs/inode.c +1 more+25 -380 replies
58/65btrfs: __btrfs_mod_refs process_func should return voidfs/btrfs/ctree.h fs/btrfs/extent-tree.c+22 -330 replies
59/65btrfs: __btrfs_mod_ref should return voidfs/btrfs/ctree.c fs/btrfs/ctree.h fs/btrfs/extent-tree.c+29 -430 replies
60/65btrfs: clean_tree_block should return voidfs/btrfs/disk-io.c fs/btrfs/disk-io.h+4 -50 replies
61/65btrfs: btrfs_truncate_item should return voidfs/btrfs/ctree.c fs/btrfs/ctree.h fs/btrfs/dir-item.c +4 more+17 -200 replies
62/65btrfs: btrfs_extend_item should return voidfs/btrfs/ctree.c fs/btrfs/ctree.h fs/btrfs/dir-item.c +4 more+16 -190 replies
63/65btrfs: end_compressed_writeback should return voidfs/btrfs/compression.c+2 -30 replies
64/65btrfs: copy_for_split should return voidfs/btrfs/ctree.c+8 -110 replies
65/65btrfs: update_inline_extent_backref should return voidfs/btrfs/extent-tree.c+11 -120 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [patch 00/65] Error handling patchset v3

Hi all -

Here's my current error handling patchset, against 3.1-rc8. Almost all of this patchset is preparing for actual error handling. Before we start in on that work, I'm trying to reduce the surface we need to worry about. It turns out that there is a ton of code that returns an error code but never actually reports an error.

The patchset has grown to 65 patches. 46 of them change functions that currently return int to return void. Many of them didn't even have the error codes checked in the caller to begin with. 10 of the patches push error codes up into the caller.

The remaining 9 patches do:
- Add a btrfs_panic facility, with a mount option to select BUG or panic
- Catch tree operation failures
- Simplify/add some wrapper functions

The biggest change, which will probably merit some discussion, is the introduction of slab-backed mempools in the delayed ref code. I expect to use this technique in other areas of the code to deal with deep failures that are impossible to recover gracefully from. Rather than returning -ENOMEM, we keep a page's worth of objects around for each node type. That allows the callers to be drastically simplified. There's no reason in particular to start with the delayed ref code, it's just where I happened to do it.

-Jeff