Fix issue of incorrect qgroup detection in #29835 #30497
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In #29835
BTRFS_IOC_INO_LOOKUP
was used for qgroup detection.However, this is not necessarily true because it only indicates the existance of tree id in btrfs.
Overall, the way to test the qgroup is to use
btrfs qgroup show <path>
and see if it returns something. The following code offers insight in checking qgroup:https://github.com/kdave/btrfs-progs/blob/v4.9/qgroup.c#L1035
This fix tries to fix the issue by using
BTRFS_IOC_TREE_SEARCH
withBTRFS_QGROUP_STATUS_KEY
instead.In case qgroup is enabled, the search for
BTRFS_QGROUP_STATUS_KEY
should be valid.Signed-off-by: Yong Tang yong.tang.github@outlook.com
/cc @cpuguy83 @tonistiigi @zhuguihua
Please take a look and sorry for the trouble and inconvenience the #29835 caused.