From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F2C9C2BD036; Wed, 4 Feb 2026 15:10:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770217806; cv=none; b=jUEmaeW493n5mzZLDk5dWdfSSWWIIA9Wnh8hxaB7EucTYK1BwPrb6nYNZMPLwSQG5/zON/MdoyAUkEjLFRIffs+KtMUpVJbCBPYBl0W24OuIhL5fXn7Xb63NS/+cVyepR4A20khNq2XKcRzaAUUXDtE1DQuModUYM5vM+u3emyk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770217806; c=relaxed/simple; bh=tYR6hR4xN2W3DXSMij7AXExPORCiPoM7AZIEp79FXkY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZrXG7sRnRLpRG1AX+O6JFLwHbvN3T/pc/m8K2MeVoiqzz7QMch6yZmSVT3zUjvr4uLnhfnA0gJ4+nL900d+VNdjwx6arfufy+1+Kv3EAUw5gR7Xnj4NLq/uI+y8I7mLuh4CGDao4fhFd0khdw0xAeV+TE97J2heIXstMKDvpX3Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=M3NFHSVY; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="M3NFHSVY" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5977FC4CEF7; Wed, 4 Feb 2026 15:10:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1770217805; bh=tYR6hR4xN2W3DXSMij7AXExPORCiPoM7AZIEp79FXkY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=M3NFHSVY4RWv0M4EHMFz4m1Rq0qQ8iQo3WYDvawCdy+qt7+C4NkN0ytcA1kNO68iM 43M5whlSFYYA3Jo1VIEscZh120ljoqkWpQpFE5MDNyMjXWAiKw2ZOQw+Be/zkgkx4Z X4Jau+BS4QCtSeNENQ6i8RX0YliROLOdD1OQik5k= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Qu Wenruo , Mark Harmstone , David Sterba , Sasha Levin Subject: [PATCH 6.1 090/280] btrfs: fix missing fields in superblock backup with BLOCK_GROUP_TREE Date: Wed, 4 Feb 2026 15:37:44 +0100 Message-ID: <20260204143912.895989242@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260204143909.614719725@linuxfoundation.org> References: <20260204143909.614719725@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Mark Harmstone [ 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 Signed-off-by: Mark Harmstone Reviewed-by: David Sterba Signed-off-by: David Sterba Signed-off-by: Sasha Levin --- fs/btrfs/disk-io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 8576ba4aa0b7d..52e083b63070d 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -1993,7 +1993,7 @@ static void backup_super_roots(struct btrfs_fs_info *info) btrfs_set_backup_chunk_root_level(root_backup, btrfs_header_level(info->chunk_root->node)); - if (!btrfs_fs_compat_ro(info, BLOCK_GROUP_TREE)) { + if (!btrfs_fs_incompat(info, EXTENT_TREE_V2)) { struct btrfs_root *extent_root = btrfs_extent_root(info, 0); struct btrfs_root *csum_root = btrfs_csum_root(info, 0); -- 2.51.0