]> 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)
commit46c5a336e850c19cd6f0948a78e79f835fc735f8
treefe2e04196c833a3b609a1cf947293aafcf90a7bd
parent8c36642e0ed3876ac5c2972d33b99af5db7ce973
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