Skip to content

Commit 1d8f69f

Browse files
maharmstonekdave
authored andcommitted
btrfs: fix missing fields in superblock backup with BLOCK_GROUP_TREE
When the BLOCK_GROUP_TREE compat_ro flag is set, the extent root and csum root fields are getting missed. This is because EXTENT_TREE_V2 treated these differently, and when they were split off this special-casing was mistakenly assigned to BGT rather than the rump EXTENT_TREE_V2. There's no reason why the existence of the block group tree should mean that we don't record the details of the last commit's extent root and csum root. Fix the code in backup_super_roots() so that the correct check gets made. Fixes: 1c56ab9 ("btrfs: separate BLOCK_GROUP_TREE compat RO flag from EXTENT_TREE_V2") Reviewed-by: Qu Wenruo <[email protected]> Signed-off-by: Mark Harmstone <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 1972f44 commit 1d8f69f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

fs/btrfs/disk-io.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1661,7 +1661,7 @@ static void backup_super_roots(struct btrfs_fs_info *info)
16611661
btrfs_set_backup_chunk_root_level(root_backup,
16621662
btrfs_header_level(info->chunk_root->node));
16631663

1664-
if (!btrfs_fs_compat_ro(info, BLOCK_GROUP_TREE)) {
1664+
if (!btrfs_fs_incompat(info, EXTENT_TREE_V2)) {
16651665
struct btrfs_root *extent_root = btrfs_extent_root(info, 0);
16661666
struct btrfs_root *csum_root = btrfs_csum_root(info, 0);
16671667

0 commit comments

Comments
 (0)