Skip to content

Commit

Permalink
btrfs: no need to run delayed refs after commit_fs_roots during commit
Browse files Browse the repository at this point in the history
The inode number cache has been removed in this dev cycle, there's one
more leftover. We don't need to run the delayed refs again after
commit_fs_roots as stated in the comment, because btrfs_save_ino_cache
is no more since 5297199 ("btrfs: remove inode number cache
feature").

Nothing else between commit_fs_roots and btrfs_qgroup_account_extents
could create new delayed refs so the qgroup consistency should be safe.

Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
  • Loading branch information
kdave committed Jan 12, 2021
1 parent e076ab2 commit 14ff8e1
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions fs/btrfs/transaction.c
Original file line number Diff line number Diff line change
Expand Up @@ -2264,14 +2264,6 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans)
*/
btrfs_free_log_root_tree(trans, fs_info);

/*
* commit_fs_roots() can call btrfs_save_ino_cache(), which generates
* new delayed refs. Must handle them or qgroup can be wrong.
*/
ret = btrfs_run_delayed_refs(trans, (unsigned long)-1);
if (ret)
goto unlock_tree_log;

/*
* Since fs roots are all committed, we can get a quite accurate
* new_roots. So let's do quota accounting.
Expand Down

0 comments on commit 14ff8e1

Please sign in to comment.