Commit 5986802c authored by Dan Carpenter's avatar Dan Carpenter Committed by Chris Mason

Btrfs: fix some error codes in btrfs_qgroup_inherit()

These are returning zero when it should be returning a negative error
code.
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
parent aa2ffd06
...@@ -1369,8 +1369,10 @@ int btrfs_qgroup_inherit(struct btrfs_trans_handle *trans, ...@@ -1369,8 +1369,10 @@ int btrfs_qgroup_inherit(struct btrfs_trans_handle *trans,
if (srcid) { if (srcid) {
srcgroup = find_qgroup_rb(fs_info, srcid); srcgroup = find_qgroup_rb(fs_info, srcid);
if (!srcgroup) if (!srcgroup) {
ret = -EINVAL;
goto unlock; goto unlock;
}
dstgroup->rfer = srcgroup->rfer - level_size; dstgroup->rfer = srcgroup->rfer - level_size;
dstgroup->rfer_cmpr = srcgroup->rfer_cmpr - level_size; dstgroup->rfer_cmpr = srcgroup->rfer_cmpr - level_size;
srcgroup->excl = level_size; srcgroup->excl = level_size;
...@@ -1379,8 +1381,10 @@ int btrfs_qgroup_inherit(struct btrfs_trans_handle *trans, ...@@ -1379,8 +1381,10 @@ int btrfs_qgroup_inherit(struct btrfs_trans_handle *trans,
qgroup_dirty(fs_info, srcgroup); qgroup_dirty(fs_info, srcgroup);
} }
if (!inherit) if (!inherit) {
ret = -EINVAL;
goto unlock; goto unlock;
}
i_qgroups = (u64 *)(inherit + 1); i_qgroups = (u64 *)(inherit + 1);
for (i = 0; i < inherit->num_qgroups; ++i) { for (i = 0; i < inherit->num_qgroups; ++i) {
......
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