History

btrfs: remove v0 extent handling

The v0 extent item has been deprecated for a long time, and we don't have any report from the community either. So it's time to remove the v0 extent specific error handling, and just treat them as regular extent tree corruption. This patch would remove the btrfs_print_v0_err() helper, and enhance the involved error handling to treat them just as any extent tree corruption. No reports regarding v0 extents have been seen since the graceful handling was added in 2018. This involves: - btrfs_backref_add_tree_node() This change is a little tricky, the new code is changed to only handle BTRFS_TREE_BLOCK_REF_KEY and BTRFS_SHARED_BLOCK_REF_KEY. But this is safe, as we have rejected any unknown inline refs through btrfs_get_extent_inline_ref_type(). For keyed backrefs, we're safe to skip anything we don't know (that's if it can pass tree-checker in the first place). - btrfs_lookup_extent_info() - lookup_inline_extent_backref() - run_delayed_extent_op() - __btrfs_free_extent() - add_tree_block() Regular error handling of unexpected extent tree item, and abort transaction (if we have a trans handle). - remove_extent_data_ref() It's pretty much the same as the regular rejection of unknown backref key. But for this particular case, we can also remove a BUG_ON(). - extent_data_ref_count() We can remove the BTRFS_EXTENT_REF_V0_KEY BUG_ON(), as it would be rejected by the only caller. - btrfs_print_leaf() Remove the handling for BTRFS_EXTENT_REF_V0_KEY.

Qu Wenruo committed 3 years ago

Commit 182741d1 parent 7f72f508 files · +48 −52Browse files

Showing the changes to include/uapi (1 of 8 files). Show all

Unified · Split

include/uapi/linux/btrfs_tree.h+5−1
@@ -220,7 +220,11 @@ · 219 unmodified lines
220 220
221#define BTRFS_EXTENT_DATA_REF_KEY 178221#define BTRFS_EXTENT_DATA_REF_KEY 178
222 222
223#define BTRFS_EXTENT_REF_V0_KEY 180223/*
224 * Obsolete key. Defintion removed in 6.6, value may be reused in the future.
225 *
226 * #define BTRFS_EXTENT_REF_V0_KEY 180
227 */
224 228
225#define BTRFS_SHARED_BLOCK_REF_KEY 182229#define BTRFS_SHARED_BLOCK_REF_KEY 182
226 230

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t