From: Greg Kroah-Hartman Date: Mon, 4 Feb 2019 07:21:25 +0000 (+0100) Subject: drop broken btrfs patch X-Git-Tag: v4.20.7~18 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=148dbca050256aad924eb3c39efd053b917dda02;p=thirdparty%2Fkernel%2Fstable-queue.git drop broken btrfs patch --- diff --git a/queue-4.19/btrfs-clean-up-pending-block-groups-when-transaction-commit-aborts.patch b/queue-4.19/btrfs-clean-up-pending-block-groups-when-transaction-commit-aborts.patch deleted file mode 100644 index 7fab4c334dc..00000000000 --- a/queue-4.19/btrfs-clean-up-pending-block-groups-when-transaction-commit-aborts.patch +++ /dev/null @@ -1,119 +0,0 @@ -From c7cc64a98512ffc41df86d14a414eb3b09bf7481 Mon Sep 17 00:00:00 2001 -From: David Sterba -Date: Wed, 23 Jan 2019 17:09:16 +0100 -Subject: btrfs: clean up pending block groups when transaction commit aborts - -From: David Sterba - -commit c7cc64a98512ffc41df86d14a414eb3b09bf7481 upstream. - -The fstests generic/475 stresses transaction aborts and can reveal -space accounting or use-after-free bugs regarding block goups. - -In this case the pending block groups that remain linked to the -structures after transaction commit aborts in the middle. - -The corrupted slabs lead to failures in following tests, eg. generic/476 - - [ 8172.752887] BUG: unable to handle kernel NULL pointer dereference at 0000000000000058 - [ 8172.755799] #PF error: [normal kernel read fault] - [ 8172.757571] PGD 661ae067 P4D 661ae067 PUD 3db8e067 PMD 0 - [ 8172.759000] Oops: 0000 [#1] PREEMPT SMP - [ 8172.760209] CPU: 0 PID: 39 Comm: kswapd0 Tainted: G W 5.0.0-rc2-default #408 - [ 8172.762495] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.11.2-0-gf9626cc-prebuilt.qemu-project.org 04/01/2014 - [ 8172.765772] RIP: 0010:shrink_page_list+0x2f9/0xe90 - [ 8172.770453] RSP: 0018:ffff967f00663b18 EFLAGS: 00010287 - [ 8172.771184] RAX: 0000000000000000 RBX: ffff967f00663c20 RCX: 0000000000000000 - [ 8172.772850] RDX: 0000000000000000 RSI: 0000000000000001 RDI: ffff8c0620ab20e0 - [ 8172.774629] RBP: ffff967f00663dd8 R08: 0000000000000000 R09: 0000000000000000 - [ 8172.776094] R10: ffff8c0620ab22f8 R11: ffff8c063f772688 R12: ffff967f00663b78 - [ 8172.777533] R13: ffff8c063f625600 R14: ffff8c063f625608 R15: dead000000000200 - [ 8172.778886] FS: 0000000000000000(0000) GS:ffff8c063d400000(0000) knlGS:0000000000000000 - [ 8172.780545] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 - [ 8172.781787] CR2: 0000000000000058 CR3: 000000004e962000 CR4: 00000000000006f0 - [ 8172.783547] Call Trace: - [ 8172.784112] shrink_inactive_list+0x194/0x410 - [ 8172.784747] shrink_node_memcg.constprop.85+0x3a5/0x6a0 - [ 8172.785472] shrink_node+0x62/0x1e0 - [ 8172.786011] balance_pgdat+0x216/0x460 - [ 8172.786577] kswapd+0xe3/0x4a0 - [ 8172.787085] ? finish_wait+0x80/0x80 - [ 8172.787795] ? balance_pgdat+0x460/0x460 - [ 8172.788799] kthread+0x116/0x130 - [ 8172.789640] ? kthread_create_on_node+0x60/0x60 - [ 8172.790323] ret_from_fork+0x24/0x30 - [ 8172.794253] CR2: 0000000000000058 - -or accounting errors at umount time: - - [ 8159.537251] WARNING: CPU: 2 PID: 19031 at fs/btrfs/extent-tree.c:5987 btrfs_free_block_groups+0x3d5/0x410 [btrfs] - [ 8159.543325] CPU: 2 PID: 19031 Comm: umount Tainted: G W 5.0.0-rc2-default #408 - [ 8159.545472] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.11.2-0-gf9626cc-prebuilt.qemu-project.org 04/01/2014 - [ 8159.548155] RIP: 0010:btrfs_free_block_groups+0x3d5/0x410 [btrfs] - [ 8159.554030] RSP: 0018:ffff967f079cbde8 EFLAGS: 00010206 - [ 8159.555144] RAX: 0000000001000000 RBX: ffff8c06366cf800 RCX: 0000000000000000 - [ 8159.556730] RDX: 0000000000000002 RSI: 0000000000000001 RDI: ffff8c06255ad800 - [ 8159.558279] RBP: ffff8c0637ac0000 R08: 0000000000000001 R09: 0000000000000000 - [ 8159.559797] R10: 0000000000000000 R11: 0000000000000001 R12: ffff8c0637ac0108 - [ 8159.561296] R13: ffff8c0637ac0158 R14: 0000000000000000 R15: dead000000000100 - [ 8159.562852] FS: 00007f7f693b9fc0(0000) GS:ffff8c063d800000(0000) knlGS:0000000000000000 - [ 8159.564839] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 - [ 8159.566160] CR2: 00007f7f68fab7b0 CR3: 000000000aec7000 CR4: 00000000000006e0 - [ 8159.567898] Call Trace: - [ 8159.568597] close_ctree+0x17f/0x350 [btrfs] - [ 8159.569628] generic_shutdown_super+0x64/0x100 - [ 8159.570808] kill_anon_super+0x14/0x30 - [ 8159.571857] btrfs_kill_super+0x12/0xa0 [btrfs] - [ 8159.573063] deactivate_locked_super+0x29/0x60 - [ 8159.574234] cleanup_mnt+0x3b/0x70 - [ 8159.575176] task_work_run+0x98/0xc0 - [ 8159.576177] exit_to_usermode_loop+0x83/0x90 - [ 8159.577315] do_syscall_64+0x15b/0x180 - [ 8159.578339] entry_SYSCALL_64_after_hwframe+0x49/0xbe - -This fix is based on 2 Josef's patches that used sideefects of -btrfs_create_pending_block_groups, this fix introduces the helper that -does what we need. - -CC: stable@vger.kernel.org # 4.4+ -CC: Josef Bacik -Reviewed-by: Nikolay Borisov -Signed-off-by: David Sterba -Signed-off-by: Greg Kroah-Hartman - ---- - fs/btrfs/transaction.c | 16 ++++++++++++++++ - 1 file changed, 16 insertions(+) - ---- a/fs/btrfs/transaction.c -+++ b/fs/btrfs/transaction.c -@@ -1886,6 +1886,21 @@ static void cleanup_transaction(struct b - kmem_cache_free(btrfs_trans_handle_cachep, trans); - } - -+/* -+ * Release reserved delayed ref space of all pending block groups of the -+ * transaction and remove them from the list -+ */ -+static void btrfs_cleanup_pending_block_groups(struct btrfs_trans_handle *trans) -+{ -+ struct btrfs_fs_info *fs_info = trans->fs_info; -+ struct btrfs_block_group_cache *block_group, *tmp; -+ -+ list_for_each_entry_safe(block_group, tmp, &trans->new_bgs, bg_list) { -+ btrfs_delayed_refs_rsv_release(fs_info, 1); -+ list_del_init(&block_group->bg_list); -+ } -+} -+ - static inline int btrfs_start_delalloc_flush(struct btrfs_fs_info *fs_info) - { - /* -@@ -2286,6 +2301,7 @@ scrub_continue: - btrfs_scrub_continue(fs_info); - cleanup_transaction: - btrfs_trans_release_metadata(trans); -+ btrfs_cleanup_pending_block_groups(trans); - btrfs_trans_release_chunk_metadata(trans); - trans->block_rsv = NULL; - btrfs_warn(fs_info, "Skipping commit of aborted transaction."); diff --git a/queue-4.19/series b/queue-4.19/series index 6bbaaeb3baa..b696b1e64bb 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -56,7 +56,6 @@ ib-hfi1-remove-overly-conservative-vm_exec-flag-check.patch platform-x86-asus-nb-wmi-map-0x35-to-key_screenlock.patch platform-x86-asus-nb-wmi-drop-mapping-of-0x33-and-0x.patch mmc-sdhci-iproc-handle-mmc_of_parse-errors-during-probe.patch -btrfs-clean-up-pending-block-groups-when-transaction-commit-aborts.patch btrfs-fix-deadlock-when-allocating-tree-block-during-leaf-node-split.patch btrfs-on-error-always-free-subvol_name-in-btrfs_mount.patch kernel-exit.c-release-ptraced-tasks-before-zap_pid_ns_processes.patch diff --git a/queue-4.20/btrfs-clean-up-pending-block-groups-when-transaction-commit-aborts.patch b/queue-4.20/btrfs-clean-up-pending-block-groups-when-transaction-commit-aborts.patch deleted file mode 100644 index d3126ec6fa1..00000000000 --- a/queue-4.20/btrfs-clean-up-pending-block-groups-when-transaction-commit-aborts.patch +++ /dev/null @@ -1,119 +0,0 @@ -From c7cc64a98512ffc41df86d14a414eb3b09bf7481 Mon Sep 17 00:00:00 2001 -From: David Sterba -Date: Wed, 23 Jan 2019 17:09:16 +0100 -Subject: btrfs: clean up pending block groups when transaction commit aborts - -From: David Sterba - -commit c7cc64a98512ffc41df86d14a414eb3b09bf7481 upstream. - -The fstests generic/475 stresses transaction aborts and can reveal -space accounting or use-after-free bugs regarding block goups. - -In this case the pending block groups that remain linked to the -structures after transaction commit aborts in the middle. - -The corrupted slabs lead to failures in following tests, eg. generic/476 - - [ 8172.752887] BUG: unable to handle kernel NULL pointer dereference at 0000000000000058 - [ 8172.755799] #PF error: [normal kernel read fault] - [ 8172.757571] PGD 661ae067 P4D 661ae067 PUD 3db8e067 PMD 0 - [ 8172.759000] Oops: 0000 [#1] PREEMPT SMP - [ 8172.760209] CPU: 0 PID: 39 Comm: kswapd0 Tainted: G W 5.0.0-rc2-default #408 - [ 8172.762495] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.11.2-0-gf9626cc-prebuilt.qemu-project.org 04/01/2014 - [ 8172.765772] RIP: 0010:shrink_page_list+0x2f9/0xe90 - [ 8172.770453] RSP: 0018:ffff967f00663b18 EFLAGS: 00010287 - [ 8172.771184] RAX: 0000000000000000 RBX: ffff967f00663c20 RCX: 0000000000000000 - [ 8172.772850] RDX: 0000000000000000 RSI: 0000000000000001 RDI: ffff8c0620ab20e0 - [ 8172.774629] RBP: ffff967f00663dd8 R08: 0000000000000000 R09: 0000000000000000 - [ 8172.776094] R10: ffff8c0620ab22f8 R11: ffff8c063f772688 R12: ffff967f00663b78 - [ 8172.777533] R13: ffff8c063f625600 R14: ffff8c063f625608 R15: dead000000000200 - [ 8172.778886] FS: 0000000000000000(0000) GS:ffff8c063d400000(0000) knlGS:0000000000000000 - [ 8172.780545] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 - [ 8172.781787] CR2: 0000000000000058 CR3: 000000004e962000 CR4: 00000000000006f0 - [ 8172.783547] Call Trace: - [ 8172.784112] shrink_inactive_list+0x194/0x410 - [ 8172.784747] shrink_node_memcg.constprop.85+0x3a5/0x6a0 - [ 8172.785472] shrink_node+0x62/0x1e0 - [ 8172.786011] balance_pgdat+0x216/0x460 - [ 8172.786577] kswapd+0xe3/0x4a0 - [ 8172.787085] ? finish_wait+0x80/0x80 - [ 8172.787795] ? balance_pgdat+0x460/0x460 - [ 8172.788799] kthread+0x116/0x130 - [ 8172.789640] ? kthread_create_on_node+0x60/0x60 - [ 8172.790323] ret_from_fork+0x24/0x30 - [ 8172.794253] CR2: 0000000000000058 - -or accounting errors at umount time: - - [ 8159.537251] WARNING: CPU: 2 PID: 19031 at fs/btrfs/extent-tree.c:5987 btrfs_free_block_groups+0x3d5/0x410 [btrfs] - [ 8159.543325] CPU: 2 PID: 19031 Comm: umount Tainted: G W 5.0.0-rc2-default #408 - [ 8159.545472] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.11.2-0-gf9626cc-prebuilt.qemu-project.org 04/01/2014 - [ 8159.548155] RIP: 0010:btrfs_free_block_groups+0x3d5/0x410 [btrfs] - [ 8159.554030] RSP: 0018:ffff967f079cbde8 EFLAGS: 00010206 - [ 8159.555144] RAX: 0000000001000000 RBX: ffff8c06366cf800 RCX: 0000000000000000 - [ 8159.556730] RDX: 0000000000000002 RSI: 0000000000000001 RDI: ffff8c06255ad800 - [ 8159.558279] RBP: ffff8c0637ac0000 R08: 0000000000000001 R09: 0000000000000000 - [ 8159.559797] R10: 0000000000000000 R11: 0000000000000001 R12: ffff8c0637ac0108 - [ 8159.561296] R13: ffff8c0637ac0158 R14: 0000000000000000 R15: dead000000000100 - [ 8159.562852] FS: 00007f7f693b9fc0(0000) GS:ffff8c063d800000(0000) knlGS:0000000000000000 - [ 8159.564839] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 - [ 8159.566160] CR2: 00007f7f68fab7b0 CR3: 000000000aec7000 CR4: 00000000000006e0 - [ 8159.567898] Call Trace: - [ 8159.568597] close_ctree+0x17f/0x350 [btrfs] - [ 8159.569628] generic_shutdown_super+0x64/0x100 - [ 8159.570808] kill_anon_super+0x14/0x30 - [ 8159.571857] btrfs_kill_super+0x12/0xa0 [btrfs] - [ 8159.573063] deactivate_locked_super+0x29/0x60 - [ 8159.574234] cleanup_mnt+0x3b/0x70 - [ 8159.575176] task_work_run+0x98/0xc0 - [ 8159.576177] exit_to_usermode_loop+0x83/0x90 - [ 8159.577315] do_syscall_64+0x15b/0x180 - [ 8159.578339] entry_SYSCALL_64_after_hwframe+0x49/0xbe - -This fix is based on 2 Josef's patches that used sideefects of -btrfs_create_pending_block_groups, this fix introduces the helper that -does what we need. - -CC: stable@vger.kernel.org # 4.4+ -CC: Josef Bacik -Reviewed-by: Nikolay Borisov -Signed-off-by: David Sterba -Signed-off-by: Greg Kroah-Hartman - ---- - fs/btrfs/transaction.c | 16 ++++++++++++++++ - 1 file changed, 16 insertions(+) - ---- a/fs/btrfs/transaction.c -+++ b/fs/btrfs/transaction.c -@@ -1889,6 +1889,21 @@ static void cleanup_transaction(struct b - kmem_cache_free(btrfs_trans_handle_cachep, trans); - } - -+/* -+ * Release reserved delayed ref space of all pending block groups of the -+ * transaction and remove them from the list -+ */ -+static void btrfs_cleanup_pending_block_groups(struct btrfs_trans_handle *trans) -+{ -+ struct btrfs_fs_info *fs_info = trans->fs_info; -+ struct btrfs_block_group_cache *block_group, *tmp; -+ -+ list_for_each_entry_safe(block_group, tmp, &trans->new_bgs, bg_list) { -+ btrfs_delayed_refs_rsv_release(fs_info, 1); -+ list_del_init(&block_group->bg_list); -+ } -+} -+ - static inline int btrfs_start_delalloc_flush(struct btrfs_fs_info *fs_info) - { - /* -@@ -2289,6 +2304,7 @@ scrub_continue: - btrfs_scrub_continue(fs_info); - cleanup_transaction: - btrfs_trans_release_metadata(trans); -+ btrfs_cleanup_pending_block_groups(trans); - btrfs_trans_release_chunk_metadata(trans); - trans->block_rsv = NULL; - btrfs_warn(fs_info, "Skipping commit of aborted transaction."); diff --git a/queue-4.20/series b/queue-4.20/series index 2a7ff16874b..cae0d685c56 100644 --- a/queue-4.20/series +++ b/queue-4.20/series @@ -63,7 +63,6 @@ ib-hfi1-remove-overly-conservative-vm_exec-flag-check.patch ib-hfi1-add-limit-test-for-rc-uc-send-via-loopback.patch platform-x86-asus-nb-wmi-map-0x35-to-key_screenlock.patch platform-x86-asus-nb-wmi-drop-mapping-of-0x33-and-0x.patch -btrfs-clean-up-pending-block-groups-when-transaction-commit-aborts.patch btrfs-fix-deadlock-when-allocating-tree-block-during-leaf-node-split.patch btrfs-on-error-always-free-subvol_name-in-btrfs_mount.patch kernel-exit.c-release-ptraced-tasks-before-zap_pid_ns_processes.patch