]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
btrfs: abort transaction on unexpected eb generation at btrfs_copy_root()
authorFilipe Manana <fdmanana@suse.com>
Tue, 19 Aug 2025 01:15:16 +0000 (21:15 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Aug 2025 14:28:40 +0000 (16:28 +0200)
commit4734255ef39b416864139dcda96a387fe5f33a6a
tree194032d6fbe3014041d6ce68a88ed6f222a8b91c
parent467dcf7e4a61d1bcbf0eb78aa18f348d7a34740d
btrfs: abort transaction on unexpected eb generation at btrfs_copy_root()

[ Upstream commit 33e8f24b52d2796b8cfb28c19a1a7dd6476323a8 ]

If we find an unexpected generation for the extent buffer we are cloning
at btrfs_copy_root(), we just WARN_ON() and don't error out and abort the
transaction, meaning we allow to persist metadata with an unexpected
generation. Instead of warning only, abort the transaction and return
-EUCLEAN.

CC: stable@vger.kernel.org # 6.1+
Reviewed-by: Daniel Vacek <neelx@suse.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/btrfs/ctree.c