Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 349174
b: refs/heads/master
c: 83bfccb
h: refs/heads/master
v: v3
  • Loading branch information
Chris Mason committed Jan 22, 2013
1 parent 87c6421 commit 96be4f9
Show file tree
Hide file tree
Showing 2 changed files with 20 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: 25122d15e21cf252e91e4cad7cea760f97df29f1
refs/heads/master: 83bfccb5c085658b0ad1450a6fc13b0bb5440970
20 changes: 19 additions & 1 deletion trunk/fs/btrfs/qgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,13 @@ int btrfs_read_qgroup_config(struct btrfs_fs_info *fs_info)

ret = add_relation_rb(fs_info, found_key.objectid,
found_key.offset);
if (ret == -ENOENT) {
printk(KERN_WARNING
"btrfs: orphan qgroup relation 0x%llx->0x%llx\n",
(unsigned long long)found_key.objectid,
(unsigned long long)found_key.offset);
ret = 0; /* ignore the error */
}
if (ret)
goto out;
next2:
Expand Down Expand Up @@ -956,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 96be4f9

Please sign in to comment.