]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: make sure to unset trans->block_rsv before running delayed refs
authorJosef Bacik <josef@redhat.com>
Mon, 19 Sep 2011 15:58:54 +0000 (11:58 -0400)
committerJosef Bacik <josef@redhat.com>
Wed, 19 Oct 2011 19:12:44 +0000 (15:12 -0400)
commite17c2869a1c9d07f95214423a31a75cf92427a8b
tree0f191662ee322e52ed7946390b6fc4bb7c0eb130
parent3224c8b8f3b71e86d2d6408090d1f512ba3f1388
Btrfs: make sure to unset trans->block_rsv before running delayed refs

Checksums are charged in 2 different ways.  The first case is when we're writing
to the disk, we account for the new checksums with the delalloc block rsv.  In
order for this to work we check if we're allocating a block for the csum root
and if trans->block_rsv == the delalloc block rsv.  But when we're deleting the
csums because of cow, this is charged to the global block rsv, and is done when
we run the delayed refs.  So we need to make sure that trans->block_rsv == NULL
when running the delayed refs.  So set it to NULL and reset it in
should_end_transaction, and set it to NULL in commit_transaction.  This got rid
of the ridiculous amount of warnings I was seeing when trying to do a balance.
Thanks,

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