]> git.baikalelectronics.ru Git - 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)
commit72936754b83df4a98ef7f096da6789a95482ab62
treeeb5eb82b9956fe7810520054a508c353d67e0b77
parent73ffcf53d6111ce78dc9deeff1b20c9233b6b43f
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: ec8c0910b212 ("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