]> www.infradead.org Git - users/jedix/linux-maple.git/commit
Btrfs: if we have a lot of pinned space, commit the transaction
authorJosef Bacik <josef@redhat.com>
Tue, 18 Oct 2011 17:07:31 +0000 (13:07 -0400)
committerChris Mason <chris.mason@oracle.com>
Wed, 16 Nov 2011 02:20:36 +0000 (21:20 -0500)
commit311d4d154f21fe90112c792359b126e4ebb1a799
tree8d8a95b52f437a97f7544431bc20cde165508442
parentad6c9de012c1ec32cd82a1987a028f51b6c83137
Btrfs: if we have a lot of pinned space, commit the transaction

Mitch kept hitting a panic because he was getting ENOSPC.  One of my previous
patches makes it so we are much better at not allocating new metadata chunks.
Unfortunately coupled with the overcommit patch this works us into a bit of a
problem if we are removing a bunch of space and end up chewing up all of our
space with pinned extents.  We can allocate chunks fine and overflow is ok, but
the only way to reclaim this space is to commit the transaction.  So if we go to
overcommit, first check and see how much pinned space we have.  If we have more
than 80% of the free space chewed up with pinned extents, just commit the
transaction, this will free up enough space for our reservation and we won't
have this problem anymore.  With this patch Mitch's test doesn't blow up
anymore.  Thanks,

Reported-and-tested-by: Mitch Harder <mitch.harder@sabayonlinux.org>
Signed-off-by: Josef Bacik <josef@redhat.com>
(cherry picked from commit 7e355b83efa80e5f5821591c13c17649594d82ac)
fs/btrfs/extent-tree.c