Skip to content

Commit 3ffad69

Browse files
josefbacikkdave
authored andcommitted
btrfs: rip the first_ticket_bytes logic from fail_all_tickets
This was a trick implemented to handle the case where we had a giant reservation in front of a bunch of little reservations in the ticket queue. If the giant reservation was too large for the transaction commit to make a difference we'd ENOSPC everybody out instead of committing the transaction. This logic was put in to force us to go back and re-try the transaction commit logic to see if we could make progress. Instead now we know we've committed the transaction, so any space that would have been recovered is now available, and would be caught by the btrfs_try_granting_tickets() in this loop, so we no longer need this code and can simply delete it. Reviewed-by: Nikolay Borisov <[email protected]> Signed-off-by: Josef Bacik <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 0480855 commit 3ffad69

File tree

1 file changed

+0
-16
lines changed

1 file changed

+0
-16
lines changed

fs/btrfs/space-info.c

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -830,7 +830,6 @@ static bool maybe_fail_all_tickets(struct btrfs_fs_info *fs_info,
830830
{
831831
struct reserve_ticket *ticket;
832832
u64 tickets_id = space_info->tickets_id;
833-
u64 first_ticket_bytes = 0;
834833

835834
if (btrfs_test_opt(fs_info, ENOSPC_DEBUG)) {
836835
btrfs_info(fs_info, "cannot satisfy tickets, dumping space info");
@@ -846,21 +845,6 @@ static bool maybe_fail_all_tickets(struct btrfs_fs_info *fs_info,
846845
steal_from_global_rsv(fs_info, space_info, ticket))
847846
return true;
848847

849-
/*
850-
* may_commit_transaction will avoid committing the transaction
851-
* if it doesn't feel like the space reclaimed by the commit
852-
* would result in the ticket succeeding. However if we have a
853-
* smaller ticket in the queue it may be small enough to be
854-
* satisfied by committing the transaction, so if any
855-
* subsequent ticket is smaller than the first ticket go ahead
856-
* and send us back for another loop through the enospc flushing
857-
* code.
858-
*/
859-
if (first_ticket_bytes == 0)
860-
first_ticket_bytes = ticket->bytes;
861-
else if (first_ticket_bytes > ticket->bytes)
862-
return true;
863-
864848
if (btrfs_test_opt(fs_info, ENOSPC_DEBUG))
865849
btrfs_info(fs_info, "failing ticket with %llu bytes",
866850
ticket->bytes);

0 commit comments

Comments
 (0)