Commit 1e5ec2e7 authored by Josef Bacik's avatar Josef Bacik Committed by Chris Mason

Btrfs: handle quota reserve failure properly

btrfs/022 was spitting a warning for the case that we exceed the quota.  If we
fail to make our quota reservation we need to clean up our data space
reservation.  Thanks,
Signed-off-by: default avatarJosef Bacik <jbacik@fb.com>
Tested-by: default avatarJeff Mahoney <jeffm@suse.com>
Signed-off-by: default avatarChris Mason <clm@fb.com>
parent b7f3c7d3
...@@ -4271,13 +4271,10 @@ int btrfs_check_data_free_space(struct inode *inode, u64 start, u64 len) ...@@ -4271,13 +4271,10 @@ int btrfs_check_data_free_space(struct inode *inode, u64 start, u64 len)
if (ret < 0) if (ret < 0)
return ret; return ret;
/* /* Use new btrfs_qgroup_reserve_data to reserve precious data space. */
* Use new btrfs_qgroup_reserve_data to reserve precious data space
*
* TODO: Find a good method to avoid reserve data space for NOCOW
* range, but don't impact performance on quota disable case.
*/
ret = btrfs_qgroup_reserve_data(inode, start, len); ret = btrfs_qgroup_reserve_data(inode, start, len);
if (ret)
btrfs_free_reserved_data_space_noquota(inode, start, len);
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment