mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-25 17:20:51 +07:00
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: Dongsheng Yang <yangds.fnst@cn.fujitsu.com> Signed-off-by: Chris Mason <clm@fb.com>
This commit is contained in:
parent
e2d1f92399
commit
09870d2772
@ -2230,6 +2230,11 @@ int btrfs_qgroup_inherit(struct btrfs_trans_handle *trans,
|
||||
ret = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
if ((srcgroup->qgroupid >> 48) <= (objectid >> 48)) {
|
||||
ret = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
++i_qgroups;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user