]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: account for pinned bytes in should_alloc_chunk
authorJeff Mahoney <jeffm@suse.com>
Thu, 22 Jun 2017 13:51:47 +0000 (09:51 -0400)
committerDavid Sterba <dsterba@suse.com>
Wed, 16 Aug 2017 14:12:05 +0000 (16:12 +0200)
commitac8334126d8c225a481951f63eb21b4f0657682e
tree2d892e37dc250abeb5ea43b0329b38c7f22485df
parentabc044f97ce469ec22c5a0c0006fa0e6dd27b42d
btrfs: account for pinned bytes in should_alloc_chunk

In a heavy write scenario, we can end up with a large number of pinned bytes.
This can translate into (very) premature ENOSPC because pinned bytes
must be accounted for when allowing a reservation but aren't accounted for
when deciding whether to create a new chunk.

This patch adds the accounting to should_alloc_chunk so that we can
create the chunk.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent-tree.c