]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: release metadata from global reserve if we have to fallback for unlink
authorJosef Bacik <josef@redhat.com>
Tue, 1 Nov 2011 18:32:23 +0000 (14:32 -0400)
committerChris Mason <chris.mason@oracle.com>
Sun, 6 Nov 2011 08:03:49 +0000 (03:03 -0500)
commit855c655fe68381270cf4d58cd21c677696dd5a09
treeddf15400e692085b5914297eb2d88989e5246c11
parent3680f17d5e0b37f71c831f9eb1331aab44913335
Btrfs: release metadata from global reserve if we have to fallback for unlink

I fixed a problem where we weren't reserving space for an orphan item when we
had to fallback to using the global reserve for an unlink, but I introduced
another problem.  I was migrating the bytes from the transaction reserve to the
global reserve and then releasing from the global reserve in
btrfs_end_transaction().  The problem with this is that a migrate will jack up
the size for the destination, but leave the size alone for the source, with the
idea that you can do a release normally on the source and it all washes out, and
then you can do a release again on the destination and it works out right.  My
way was skipping the release on the trans_block_rsv which still had the jacked
up size from our original reservation.  So instead release manually from the
global reserve if this transaction was using it, and then set the
trans->block_rsv back to the trans_block_rsv so that btrfs_end_transaction
cleans everything up properly.  With this patch xfstest 83 doesn't emit warnings
about leaking space.  Thanks,

Signed-off-by: Josef Bacik <josef@redhat.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/btrfs/inode.c