]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: do transaction space reservation before joining the transaction
authorJosef Bacik <josef@redhat.com>
Tue, 7 Jun 2011 19:07:51 +0000 (15:07 -0400)
committerJosef Bacik <josef@redhat.com>
Mon, 11 Jul 2011 13:58:47 +0000 (09:58 -0400)
commit0b1584ac377b164f90566afda565416e1dfa6657
treefe2e04196c833a3b609a1cf947293aafcf90a7bd
parent3968eed5b35ebfa71adf6d760c7c74913fee22db
Btrfs: do transaction space reservation before joining the transaction

We have to do weird things when handling enospc in the transaction joining code.
Because we've already joined the transaction we cannot commit the transaction
within the reservation code since it will deadlock, so we have to return EAGAIN
and then make sure we don't retry too many times.  Instead of doing this, just
do the reservation the normal way before we join the transaction, that way we
can do whatever we want to try and reclaim space, and then if it fails we know
for sure we are out of space and we can return ENOSPC.  Thanks,

Signed-off-by: Josef Bacik <josef@redhat.com>
fs/btrfs/ctree.h
fs/btrfs/extent-tree.c
fs/btrfs/transaction.c