Skip to content

Commit

Permalink
btrfs: don't arbitrarily slow down delalloc if we're committing
Browse files Browse the repository at this point in the history
commit 11aeb97 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>
  • Loading branch information
josefbacik authored and gregkh committed Nov 28, 2023
1 parent 94fda7e commit 5b2ed3c
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions fs/btrfs/delalloc-space.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 5b2ed3c

Please sign in to comment.