diff options
author | Qu Wenruo <wqu@suse.com> | 2024-02-20 14:31:34 +1030 |
---|---|---|
committer | Zorro Lang <zlang@kernel.org> | 2024-03-01 19:22:36 +0800 |
commit | 662db267353858df126c1fc731fbe77fe4b3e1bf (patch) | |
tree | b2e6d221ef39f2dfac08cb1fb03fb328891df0d4 | |
parent | 779ae21a305df5ef7133f26e02aa72d2416262ca (diff) | |
download | xfstests-dev-662db267353858df126c1fc731fbe77fe4b3e1bf.tar.gz |
btrfs: detect regular qgroup for older kernels correctly
[BUG]
When running an older (vendoer v6.4) kernel, some qgroup test cases
would be skipped:
btrfs/017 1s ... [not run] not running normal qgroups
[CAUSE]
With the introduce of simple quota mode, there is a new sysfs interface,
/sys/fs/btrfs/<uuid>/qgroups/mode to indicate the currently running
qgroup modes.
And _qgroup_mode() from `common/btrfs` is using that new interface to
detect the mode.
Unfortuantely for older kernels without simple quota support,
_qgroup_mode() would return "disabled" directly, causing those test case
to be skipped.
[FIX]
Fallback to regular qgroup if that sysfs interface is not accessible, as
qgroup is introduced from the very beginning of btrfs, thus the regular
qgroup is always supported.
Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: Anand Jain <anand.jain@oracle.com>
-rw-r--r-- | common/btrfs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/common/btrfs b/common/btrfs index 7141a0bb7b..3eb2a91b75 100644 --- a/common/btrfs +++ b/common/btrfs @@ -739,7 +739,7 @@ _qgroup_mode() if _has_fs_sysfs_attr $dev /qgroups/mode; then _get_fs_sysfs_attr $dev qgroups/mode else - echo "disabled" + echo "qgroup" fi } |