From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id D09E2158020 for ; Thu, 10 Nov 2022 18:18:33 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 1D5572BC004; Thu, 10 Nov 2022 18:18:33 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 0676E2BC004 for ; Thu, 10 Nov 2022 18:18:33 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 28B5A340E7F for ; Thu, 10 Nov 2022 18:18:32 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id BB4B06E9 for ; Thu, 10 Nov 2022 18:18:30 +0000 (UTC) From: "Mike Pagano" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Mike Pagano" Message-ID: <1668104284.e9f10a9f82f0947e4dbab972345827bf6ddcd393.mpagano@gentoo> Subject: [gentoo-commits] proj/linux-patches:6.0 commit in: / X-VCS-Repository: proj/linux-patches X-VCS-Files: 0000_README 1900_btrfs-chunk-sub_stripes-fix.patch X-VCS-Directories: / X-VCS-Committer: mpagano X-VCS-Committer-Name: Mike Pagano X-VCS-Revision: e9f10a9f82f0947e4dbab972345827bf6ddcd393 X-VCS-Branch: 6.0 Date: Thu, 10 Nov 2022 18:18:30 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 7805b623-83ab-4eb0-86b6-755406669b59 X-Archives-Hash: d44dc3e13876fc6b7567ecc06b643809 commit: e9f10a9f82f0947e4dbab972345827bf6ddcd393 Author: Mike Pagano gentoo org> AuthorDate: Thu Nov 10 18:18:04 2022 +0000 Commit: Mike Pagano gentoo org> CommitDate: Thu Nov 10 18:18:04 2022 +0000 URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=e9f10a9f Remove redundant patch Removed: btrfs: Don't use btrfs_chunk::sub_stripes from disk Signed-off-by: Mike Pagano gentoo.org> 0000_README | 4 -- 1900_btrfs-chunk-sub_stripes-fix.patch | 92 ---------------------------------- 2 files changed, 96 deletions(-) diff --git a/0000_README b/0000_README index 52ac8549..04880a09 100644 --- a/0000_README +++ b/0000_README @@ -87,10 +87,6 @@ Patch: 1700_sparc-address-warray-bound-warnings.patch From: https://github.com/KSPP/linux/issues/109 Desc: Address -Warray-bounds warnings -Patch: 1900_btrfs-chunk-sub_stripes-fix.patch -From: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git -Desc: btrfs: Don't use btrfs_chunk::sub_stripes from disk - Patch: 2000_BT-Check-key-sizes-only-if-Secure-Simple-Pairing-enabled.patch From: https://lore.kernel.org/linux-bluetooth/20190522070540.48895-1-marcel@holtmann.org/raw Desc: Bluetooth: Check key sizes only when Secure Simple Pairing is enabled. See bug #686758 diff --git a/1900_btrfs-chunk-sub_stripes-fix.patch b/1900_btrfs-chunk-sub_stripes-fix.patch deleted file mode 100644 index 2ffe02fe..00000000 --- a/1900_btrfs-chunk-sub_stripes-fix.patch +++ /dev/null @@ -1,92 +0,0 @@ -From 76a66ba101329316a5d7f4275070be22eb85fdf2 Mon Sep 17 00:00:00 2001 -From: Qu Wenruo -Date: Fri, 21 Oct 2022 08:43:45 +0800 -Subject: btrfs: don't use btrfs_chunk::sub_stripes from disk - -[BUG] -There are two reports (the earliest one from LKP, a more recent one from -kernel bugzilla) that we can have some chunks with 0 as sub_stripes. - -This will cause divide-by-zero errors at btrfs_rmap_block, which is -introduced by a recent kernel patch ac0677348f3c ("btrfs: merge -calculations for simple striped profiles in btrfs_rmap_block"): - - if (map->type & (BTRFS_BLOCK_GROUP_RAID0 | - BTRFS_BLOCK_GROUP_RAID10)) { - stripe_nr = stripe_nr * map->num_stripes + i; - stripe_nr = div_u64(stripe_nr, map->sub_stripes); <<< - } - -[CAUSE] -From the more recent report, it has been proven that we have some chunks -with 0 as sub_stripes, mostly caused by older mkfs. - -It turns out that the mkfs.btrfs fix is only introduced in 6718ab4d33aa -("btrfs-progs: Initialize sub_stripes to 1 in btrfs_alloc_data_chunk") -which is included in v5.4 btrfs-progs release. - -So there would be quite some old filesystems with such 0 sub_stripes. - -[FIX] -Just don't trust the sub_stripes values from disk. - -We have a trusted btrfs_raid_array[] to fetch the correct sub_stripes -numbers for each profile and that are fixed. - -By this, we can keep the compatibility with older filesystems while -still avoid divide-by-zero bugs. - -Reported-by: kernel test robot -Reported-by: Viktor Kuzmin -Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=216559 -Fixes: ac0677348f3c ("btrfs: merge calculations for simple striped profiles in btrfs_rmap_block") -CC: stable@vger.kernel.org # 6.0 -Reviewed-by: Su Yue -Reviewed-by: Johannes Thumshirn -Signed-off-by: Qu Wenruo -Signed-off-by: David Sterba ---- - fs/btrfs/volumes.c | 12 +++++++++++- - 1 file changed, 11 insertions(+), 1 deletion(-) - -(limited to 'fs/btrfs/volumes.c') - -diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c -index 94ba46d579205..a8d4bc6a19379 100644 ---- a/fs/btrfs/volumes.c -+++ b/fs/btrfs/volumes.c -@@ -7142,6 +7142,7 @@ static int read_one_chunk(struct btrfs_key *key, struct extent_buffer *leaf, - u64 devid; - u64 type; - u8 uuid[BTRFS_UUID_SIZE]; -+ int index; - int num_stripes; - int ret; - int i; -@@ -7149,6 +7150,7 @@ static int read_one_chunk(struct btrfs_key *key, struct extent_buffer *leaf, - logical = key->offset; - length = btrfs_chunk_length(leaf, chunk); - type = btrfs_chunk_type(leaf, chunk); -+ index = btrfs_bg_flags_to_raid_index(type); - num_stripes = btrfs_chunk_num_stripes(leaf, chunk); - - #if BITS_PER_LONG == 32 -@@ -7202,7 +7204,15 @@ static int read_one_chunk(struct btrfs_key *key, struct extent_buffer *leaf, - map->io_align = btrfs_chunk_io_align(leaf, chunk); - map->stripe_len = btrfs_chunk_stripe_len(leaf, chunk); - map->type = type; -- map->sub_stripes = btrfs_chunk_sub_stripes(leaf, chunk); -+ /* -+ * We can't use the sub_stripes value, as for profiles other than -+ * RAID10, they may have 0 as sub_stripes for filesystems created by -+ * older mkfs (sub_stripes = btrfs_raid_array[index].sub_stripes; - map->verified_stripes = 0; - em->orig_block_len = btrfs_calc_stripe_length(em); - for (i = 0; i < num_stripes; i++) { --- -cgit