Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 349153
b: refs/heads/master
c: 2cf6870
h: refs/heads/master
i:
  349151: 91fbd31
v: v3
  • Loading branch information
Arne Jansen authored and Chris Mason committed Jan 22, 2013
1 parent 5c9d373 commit d4832c1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ff24858c65d9c518af41aad22fb964685351051a
refs/heads/master: 2cf687039676c2b6e1ee96b0b89090aca94babcd
13 changes: 12 additions & 1 deletion trunk/fs/btrfs/qgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -963,17 +963,28 @@ int btrfs_remove_qgroup(struct btrfs_trans_handle *trans,
struct btrfs_fs_info *fs_info, u64 qgroupid)
{
struct btrfs_root *quota_root;
struct btrfs_qgroup *qgroup;
int ret = 0;

quota_root = fs_info->quota_root;
if (!quota_root)
return -EINVAL;

/* check if there are no relations to this qgroup */
spin_lock(&fs_info->qgroup_lock);
qgroup = find_qgroup_rb(fs_info, qgroupid);
if (qgroup) {
if (!list_empty(&qgroup->groups) || !list_empty(&qgroup->members)) {
spin_unlock(&fs_info->qgroup_lock);
return -EBUSY;
}
}
spin_unlock(&fs_info->qgroup_lock);

ret = del_qgroup_item(trans, quota_root, qgroupid);

spin_lock(&fs_info->qgroup_lock);
del_qgroup_rb(quota_root->fs_info, qgroupid);

spin_unlock(&fs_info->qgroup_lock);

return ret;
Expand Down

0 comments on commit d4832c1

Please sign in to comment.