From: Qu Wenruo Date: Tue, 20 Feb 2024 04:01:34 +0000 (+1030) Subject: btrfs: detect regular qgroup for older kernels correctly X-Git-Tag: v2024.03.03~13 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=662db267353858df126c1fc731fbe77fe4b3e1bf;p=xfstests-dev.git 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//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 Reviewed-by: Filipe Manana Reviewed-by: Anand Jain Signed-off-by: Anand Jain --- diff --git a/common/btrfs b/common/btrfs index 7141a0bb..3eb2a91b 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 }