From: Greg Kroah-Hartman Date: Fri, 15 Apr 2022 04:56:58 +0000 (+0200) Subject: 5.10-stable patches X-Git-Tag: v4.19.238~10 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=028fd42c1f572018feb4226f4f137ff4b596a835;p=thirdparty%2Fkernel%2Fstable-queue.git 5.10-stable patches added patches: btrfs-remove-unused-variable-in-btrfs_-start-write-_dirty_block_groups.patch --- diff --git a/queue-5.10/btrfs-remove-unused-variable-in-btrfs_-start-write-_dirty_block_groups.patch b/queue-5.10/btrfs-remove-unused-variable-in-btrfs_-start-write-_dirty_block_groups.patch new file mode 100644 index 00000000000..2b5d5c9b768 --- /dev/null +++ b/queue-5.10/btrfs-remove-unused-variable-in-btrfs_-start-write-_dirty_block_groups.patch @@ -0,0 +1,68 @@ +From 6d4a6b515c39f1f8763093e0f828959b2fbc2f45 Mon Sep 17 00:00:00 2001 +From: Nathan Chancellor +Date: Thu, 24 Mar 2022 08:36:45 -0700 +Subject: btrfs: remove unused variable in btrfs_{start,write}_dirty_block_groups() + +From: Nathan Chancellor + +commit 6d4a6b515c39f1f8763093e0f828959b2fbc2f45 upstream. + +Clang's version of -Wunused-but-set-variable recently gained support for +unary operations, which reveals two unused variables: + + fs/btrfs/block-group.c:2949:6: error: variable 'num_started' set but not used [-Werror,-Wunused-but-set-variable] + int num_started = 0; + ^ + fs/btrfs/block-group.c:3116:6: error: variable 'num_started' set but not used [-Werror,-Wunused-but-set-variable] + int num_started = 0; + ^ + 2 errors generated. + +These variables appear to be unused from their introduction, so just +remove them to silence the warnings. + +Fixes: c9dc4c657850 ("Btrfs: two stage dirty block group writeout") +Fixes: 1bbc621ef284 ("Btrfs: allow block group cache writeout outside critical section in commit") +CC: stable@vger.kernel.org # 5.4+ +Link: https://github.com/ClangBuiltLinux/linux/issues/1614 +Signed-off-by: Nathan Chancellor +Signed-off-by: David Sterba +Signed-off-by: Greg Kroah-Hartman +--- + fs/btrfs/block-group.c | 4 ---- + 1 file changed, 4 deletions(-) + +--- a/fs/btrfs/block-group.c ++++ b/fs/btrfs/block-group.c +@@ -2570,7 +2570,6 @@ int btrfs_start_dirty_block_groups(struc + struct btrfs_path *path = NULL; + LIST_HEAD(dirty); + struct list_head *io = &cur_trans->io_bgs; +- int num_started = 0; + int loops = 0; + + spin_lock(&cur_trans->dirty_bgs_lock); +@@ -2636,7 +2635,6 @@ again: + cache->io_ctl.inode = NULL; + ret = btrfs_write_out_cache(trans, cache, path); + if (ret == 0 && cache->io_ctl.inode) { +- num_started++; + should_put = 0; + + /* +@@ -2737,7 +2735,6 @@ int btrfs_write_dirty_block_groups(struc + int should_put; + struct btrfs_path *path; + struct list_head *io = &cur_trans->io_bgs; +- int num_started = 0; + + path = btrfs_alloc_path(); + if (!path) +@@ -2795,7 +2792,6 @@ int btrfs_write_dirty_block_groups(struc + cache->io_ctl.inode = NULL; + ret = btrfs_write_out_cache(trans, cache, path); + if (ret == 0 && cache->io_ctl.inode) { +- num_started++; + should_put = 0; + list_add_tail(&cache->io_list, io); + } else { diff --git a/queue-5.10/series b/queue-5.10/series index c4d7eb23fde..3f85173faf6 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -3,3 +3,4 @@ hamradio-defer-6pack-kfree-after-unregister_netdev.patch hamradio-remove-needs_free_netdev-to-avoid-uaf.patch cpuidle-psci-move-the-has_lpi-check-to-the-beginning-of-the-function.patch acpi-processor-idle-check-for-architectural-support-for-lpi.patch +btrfs-remove-unused-variable-in-btrfs_-start-write-_dirty_block_groups.patch