From 4912de109bc96444f2fec22e2bf58858e31d16f4 Mon Sep 17 00:00:00 2001 From: Jiri Slaby Date: Apr 20 2023 11:00:10 +0000 Subject: btrfs: restore the thread_pool= behavior in remount for the end I/O workqueues (bsc#1012628). --- diff --git a/patches.kernel.org/6.2.12-018-btrfs-restore-the-thread_pool-behavior-in-remo.patch b/patches.kernel.org/6.2.12-018-btrfs-restore-the-thread_pool-behavior-in-remo.patch new file mode 100644 index 0000000..af67723 --- /dev/null +++ b/patches.kernel.org/6.2.12-018-btrfs-restore-the-thread_pool-behavior-in-remo.patch @@ -0,0 +1,42 @@ +From: Christoph Hellwig +Date: Tue, 28 Mar 2023 12:56:13 +0900 +Subject: [PATCH] btrfs: restore the thread_pool= behavior in remount for the + end I/O workqueues +References: bsc#1012628 +Patch-mainline: 6.2.12 +Git-commit: 40fac6472f22a59f5694496e179988ab4a1dfe07 + +commit 40fac6472f22a59f5694496e179988ab4a1dfe07 upstream. + +Commit d7b9416fe5c5 ("btrfs: remove btrfs_end_io_wq") converted the read +and I/O handling from btrfs_workqueues to Linux workqueues, and as part +of that lost the code to apply the thread_pool= based max_active limit +on remount. Restore it. + +Fixes: d7b9416fe5c5 ("btrfs: remove btrfs_end_io_wq") +CC: stable@vger.kernel.org # 6.0+ +Signed-off-by: Christoph Hellwig +Reviewed-by: David Sterba +Signed-off-by: David Sterba +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Jiri Slaby +--- + fs/btrfs/super.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c +index 433ce221..8dd8f56b 100644 +--- a/fs/btrfs/super.c ++++ b/fs/btrfs/super.c +@@ -1630,6 +1630,8 @@ static void btrfs_resize_thread_pool(struct btrfs_fs_info *fs_info, + btrfs_workqueue_set_max(fs_info->hipri_workers, new_pool_size); + btrfs_workqueue_set_max(fs_info->delalloc_workers, new_pool_size); + btrfs_workqueue_set_max(fs_info->caching_workers, new_pool_size); ++ workqueue_set_max_active(fs_info->endio_workers, new_pool_size); ++ workqueue_set_max_active(fs_info->endio_meta_workers, new_pool_size); + btrfs_workqueue_set_max(fs_info->endio_write_workers, new_pool_size); + btrfs_workqueue_set_max(fs_info->endio_freespace_worker, new_pool_size); + btrfs_workqueue_set_max(fs_info->delayed_workers, new_pool_size); +-- +2.35.3 + diff --git a/series.conf b/series.conf index 84a2019..04c432b 100644 --- a/series.conf +++ b/series.conf @@ -2245,6 +2245,7 @@ patches.kernel.org/6.2.12-015-bluetooth-btbcm-Fix-logic-error-in-forming-the.patch patches.kernel.org/6.2.12-016-Bluetooth-Free-potentially-unfreed-SCO-connect.patch patches.kernel.org/6.2.12-017-Bluetooth-hci_conn-Fix-possible-UAF.patch + patches.kernel.org/6.2.12-018-btrfs-restore-the-thread_pool-behavior-in-remo.patch ######################################################## # Build fixes that apply to the vanilla kernel too.