]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
Btrfs: skip commit transaction if we don't have enough pinned bytes
authorLiu Bo <bo.li.liu@oracle.com>
Fri, 19 May 2017 17:39:15 +0000 (11:39 -0600)
committerDavid Sterba <dsterba@suse.com>
Mon, 19 Jun 2017 16:26:00 +0000 (18:26 +0200)
commit28785f70ef882e4798cd5706066a55dbf7adf80e
treeeb5eb82b9956fe7810520054a508c353d67e0b77
parent4e2814ef04080fae123edf8fcef555f5a424e7ba
Btrfs: skip commit transaction if we don't have enough pinned bytes

We commit transaction in order to reclaim space from pinned bytes because
it could process delayed refs, and in may_commit_transaction(), we check
first if pinned bytes are enough for the required space, we then check if
that plus bytes reserved for delayed insert are enough for the required
space.

This changes the code to the above logic.

Fixes: b150a4f10d87 ("Btrfs: use a percpu to keep track of possibly pinned bytes")
Tested-by: Nikolay Borisov <nborisov@suse.com>
Reported-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent-tree.c