Skip to content
Snippets Groups Projects
Commit 09870d27 authored by Dongsheng Yang's avatar Dongsheng Yang Committed by Chris Mason
Browse files

btrfs: qgroup: return EINVAL if level of parent is not higher than child's.


When we create a subvol inheriting a qgroup, we need to check the level
of them. Otherwise, there is a chance a qgroup can inherit another qgroup
at the same level.

Signed-off-by: default avatarDongsheng Yang <yangds.fnst@cn.fujitsu.com>
Signed-off-by: default avatarChris Mason <clm@fb.com>
parent e2d1f923
No related branches found
No related tags found
No related merge requests found
...@@ -2230,6 +2230,11 @@ int btrfs_qgroup_inherit(struct btrfs_trans_handle *trans, ...@@ -2230,6 +2230,11 @@ int btrfs_qgroup_inherit(struct btrfs_trans_handle *trans,
ret = -EINVAL; ret = -EINVAL;
goto out; goto out;
} }
if ((srcgroup->qgroupid >> 48) <= (objectid >> 48)) {
ret = -EINVAL;
goto out;
}
++i_qgroups; ++i_qgroups;
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment