Skip to content

Commit

Permalink
Btrfs: make sure to use the delalloc reserve when filling delalloc
Browse files Browse the repository at this point in the history
In the prealloc filling code and compressed code we don't set trans->block_rsv
to the delalloc block reserve properly, which is going to make us use metadata
from the wrong pool, this patch fixes that.  Thanks,

Signed-off-by: Josef Bacik <josef@redhat.com>
  • Loading branch information
Josef Bacik committed May 23, 2011
1 parent 61c4f2c commit 74b2107
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fs/btrfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,7 @@ static noinline int submit_compressed_extents(struct inode *inode,

trans = btrfs_join_transaction(root, 1);
BUG_ON(IS_ERR(trans));
trans->block_rsv = &root->fs_info->delalloc_block_rsv;
ret = btrfs_reserve_extent(trans, root,
async_extent->compressed_size,
async_extent->compressed_size,
Expand Down Expand Up @@ -1060,6 +1061,7 @@ static noinline int run_delalloc_nocow(struct inode *inode,
trans = btrfs_join_transaction(root, 1);
}
BUG_ON(IS_ERR(trans));
trans->block_rsv = &root->fs_info->delalloc_block_rsv;

cow_start = (u64)-1;
cur_offset = start;
Expand Down

0 comments on commit 74b2107

Please sign in to comment.