]> www.infradead.org Git - users/hch/xfstests-dev.git/commitdiff
btrfs: detect regular qgroup for older kernels correctly
authorQu Wenruo <wqu@suse.com>
Tue, 20 Feb 2024 04:01:34 +0000 (14:31 +1030)
committerZorro Lang <zlang@kernel.org>
Fri, 1 Mar 2024 11:22:36 +0000 (19:22 +0800)
[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>
common/btrfs

index 7141a0bb7b786289d2f1b2402df78f2653c5b0b0..3eb2a91b752806f69c9a2c556118e095a777815b 100644 (file)
@@ -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
 }