Skip to contentSkip to conversation

btrfs: no need to run delayed refs after commit_fs_roots

PATCH In review David Sterba 2 participants 2 messages Jan 8, 2021 – Jan 11, 2021 Btrfs file system

lore
Share & tools
lore

David Sterba

author maintainer
#0 lore raw

PATCH 1/1 btrfs: no need to run delayed refs after commit_fs_roots

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 5297199a8bca ("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.

---

There's the patchset
https://lore.kernel.org/linux-btrfs/[email protected]/
to remove several other run delayed ref calls. I haven't spotted any problems so this patch can go in now as it's related to the inode cache removal. The patchset unifies the location of delayed refs calls so this one would be an outlier anyway.

 fs/btrfs/transaction.c | 8 --------
 1 file changed, 8 deletions(-)
fs/btrfs/transaction.c +0 -8
index 4ffe66164fa3..3bcb5444536e 100644
@@ -2265,14 +2265,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.
Signature · 1 line
2.25.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · David Sterba

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 5297199a8bca ("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.