Btrfs: handle enospc accounting for free space inodes

Since free space inodes now use normal checksumming we need to make sure to
account for their metadata use.  So reserve metadata space, and then if we fail
to write out the metadata we can just release it, otherwise it will be freed up
when the io completes.  Thanks,

Signed-off-by: Josef Bacik <josef@redhat.com>
This commit is contained in:
Josef Bacik
2011-08-30 10:19:10 -04:00
parent 300e4f8a56
commit c09544e07f
4 changed files with 47 additions and 23 deletions

View File

@@ -1792,11 +1792,11 @@ static int btrfs_finish_ordered_io(struct inode *inode, u64 start, u64 end)
}
ret = 0;
out:
btrfs_delalloc_release_metadata(inode, ordered_extent->len);
if (nolock) {
if (trans)
btrfs_end_transaction_nolock(trans, root);
} else {
btrfs_delalloc_release_metadata(inode, ordered_extent->len);
if (trans)
btrfs_end_transaction(trans, root);
}