]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
btrfs: fix missing fields in superblock backup with BLOCK_GROUP_TREE
authorMark Harmstone <mark@harmstone.com>
Tue, 13 Jan 2026 18:37:56 +0000 (18:37 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 30 Jan 2026 09:27:31 +0000 (10:27 +0100)
commitce5ee09c0aeeaa4d01076a577a7055e06890cafb
tree47a1aa3191f0338da192fc45047925df8f64e1a7
parent774089dc718f59f9b40d0fb1eb516ddfe4ec25a5
btrfs: fix missing fields in superblock backup with BLOCK_GROUP_TREE

[ Upstream commit 1d8f69f453c2e8a2d99b158e58e02ed65031fa6d ]

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: 1c56ab991903 ("btrfs: separate BLOCK_GROUP_TREE compat RO flag from EXTENT_TREE_V2")
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Mark Harmstone <mark@harmstone.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/btrfs/disk-io.c