btrfs: pass correct args to btrfs_async_run_delayed_refs()
authorWang Xiaoguang <wangxg.fnst@cn.fujitsu.com>
Tue, 18 Oct 2016 07:56:13 +0000 (15:56 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 24 Oct 2016 16:20:29 +0000 (18:20 +0200)
In btrfs_truncate_inode_items()->btrfs_async_run_delayed_refs(), we
swap the arg2 and arg3 wrongly, fix this.

This bug just impacts asynchronous delayed refs handle when we truncate inodes.
In delayed_ref_async_start(), there is such codes:

    trans = btrfs_join_transaction(async->root);
    if (trans->transid > async->transid)
        goto end;
    ret = btrfs_run_delayed_refs(trans, async->root, async->count);

From this codes, we can see that this just influence whether can we handle
delayed refs or the number of delayed refs to handle, this may impact
performance, but will not result in missing delayed refs, all delayed refs will
be handled in btrfs_commit_transaction().

Signed-off-by: Wang Xiaoguang <wangxg.fnst@cn.fujitsu.com>
Reviewed-by: Holger Hoffstätte <holger@applied-asynchrony.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/inode.c

index 6677674d0505a611694993eced8ee9e33d09f544..1f980efbb2e8d653c7544d7fe130b02c5f392547 100644 (file)
@@ -4605,8 +4605,8 @@ delete:
                        BUG_ON(ret);
                        if (btrfs_should_throttle_delayed_refs(trans, root))
                                btrfs_async_run_delayed_refs(root,
-                                                            trans->transid,
-                                       trans->delayed_ref_updates * 2, 0);
+                                       trans->delayed_ref_updates * 2,
+                                       trans->transid, 0);
                        if (be_nice) {
                                if (truncate_space_check(trans, root,
                                                         extent_num_bytes)) {