]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
btrfs: don't arbitrarily slow down delalloc if we're committing
authorJosef Bacik <josef@toxicpanda.com>
Mon, 18 Sep 2023 18:15:33 +0000 (14:15 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 28 Nov 2023 16:56:29 +0000 (16:56 +0000)
commit 11aeb97b45ad2e0040cbb2a589bc403152526345 upstream.

We have a random schedule_timeout() if the current transaction is
committing, which seems to be a holdover from the original delalloc
reservation code.

Remove this, we have the proper flushing stuff, we shouldn't be hoping
for random timing things to make everything work.  This just induces
latency for no reason.

CC: stable@vger.kernel.org # 5.4+
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/btrfs/delalloc-space.c

index b934429c24350f2d8e213cd9a41ad5c46e560091..4feddabe40a4aa23fa3074c0c6f4eaabb6d29225 100644 (file)
@@ -312,9 +312,6 @@ int btrfs_delalloc_reserve_metadata(struct btrfs_inode *inode, u64 num_bytes)
        } else {
                if (current->journal_info)
                        flush = BTRFS_RESERVE_FLUSH_LIMIT;
-
-               if (btrfs_transaction_in_commit(fs_info))
-                       schedule_timeout(1);
        }
 
        num_bytes = ALIGN(num_bytes, fs_info->sectorsize);