Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 374858
b: refs/heads/master
c: 3f5e2d3
h: refs/heads/master
v: v3
  • Loading branch information
Wang Shilong authored and Josef Bacik committed May 6, 2013
1 parent 6a78a31 commit 80cc7a4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b7fef4f593007d52ba7fe4427e099bd71c63c521
refs/heads/master: 3f5e2d3b3877d34231bbe45856f3b78b7692e472
15 changes: 15 additions & 0 deletions trunk/fs/btrfs/qgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -1412,6 +1412,7 @@ int btrfs_qgroup_inherit(struct btrfs_trans_handle *trans,
struct btrfs_qgroup *srcgroup;
struct btrfs_qgroup *dstgroup;
u32 level_size = 0;
u64 nums;

mutex_lock(&fs_info->qgroup_ioctl_lock);
if (!fs_info->quota_enabled)
Expand All @@ -1422,6 +1423,20 @@ int btrfs_qgroup_inherit(struct btrfs_trans_handle *trans,
goto out;
}

if (inherit) {
i_qgroups = (u64 *)(inherit + 1);
nums = inherit->num_qgroups + 2 * inherit->num_ref_copies +
2 * inherit->num_excl_copies;
for (i = 0; i < nums; ++i) {
srcgroup = find_qgroup_rb(fs_info, *i_qgroups);
if (!srcgroup) {
ret = -EINVAL;
goto out;
}
++i_qgroups;
}
}

/*
* create a tracking group for the subvol itself
*/
Expand Down

0 comments on commit 80cc7a4

Please sign in to comment.