Skip to content

Commit

Permalink
Btrfs: unlock on error in btrfs_delalloc_reserve_metadata()
Browse files Browse the repository at this point in the history
We should release this mutex before returning the error code.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
  • Loading branch information
Dan Carpenter authored and Chris Mason committed Aug 28, 2012
1 parent 57a5a88 commit 55e591f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fs/btrfs/extent-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -4571,8 +4571,10 @@ int btrfs_delalloc_reserve_metadata(struct inode *inode, u64 num_bytes)
if (root->fs_info->quota_enabled) {
ret = btrfs_qgroup_reserve(root, num_bytes +
nr_extents * root->leafsize);
if (ret)
if (ret) {
mutex_unlock(&BTRFS_I(inode)->delalloc_mutex);
return ret;
}
}

ret = reserve_metadata_bytes(root, block_rsv, to_reserve, flush);
Expand Down

0 comments on commit 55e591f

Please sign in to comment.