From: Josef Bacik Date: Mon, 18 Sep 2023 18:15:33 +0000 (-0400) Subject: btrfs: don't arbitrarily slow down delalloc if we're committing X-Git-Tag: v6.7-rc1~202^2~88 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=11aeb97b45ad;p=thirdparty%2Flinux.git btrfs: don't arbitrarily slow down delalloc if we're committing 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 Reviewed-by: David Sterba Signed-off-by: David Sterba --- diff --git a/fs/btrfs/delalloc-space.c b/fs/btrfs/delalloc-space.c index a764db67c033b..51453d4928fa4 100644 --- a/fs/btrfs/delalloc-space.c +++ b/fs/btrfs/delalloc-space.c @@ -322,9 +322,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);