public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fstests: btrfs: detect regular qgroup for older kernels correctly
@ 2024-02-20  4:01 Qu Wenruo
  2024-02-20 11:11 ` Filipe Manana
  2024-02-26  6:36 ` Anand Jain
  0 siblings, 2 replies; 3+ messages in thread
From: Qu Wenruo @ 2024-02-20  4:01 UTC (permalink / raw)
  To: linux-btrfs, fstests

[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>
---
 common/btrfs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/btrfs b/common/btrfs
index e1b29c61..0a3f0f0b 100644
--- a/common/btrfs
+++ b/common/btrfs
@@ -728,7 +728,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
 }
 
-- 
2.42.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] fstests: btrfs: detect regular qgroup for older kernels correctly
  2024-02-20  4:01 [PATCH] fstests: btrfs: detect regular qgroup for older kernels correctly Qu Wenruo
@ 2024-02-20 11:11 ` Filipe Manana
  2024-02-26  6:36 ` Anand Jain
  1 sibling, 0 replies; 3+ messages in thread
From: Filipe Manana @ 2024-02-20 11:11 UTC (permalink / raw)
  To: Qu Wenruo; +Cc: linux-btrfs, fstests

On Tue, Feb 20, 2024 at 4:01 AM Qu Wenruo <wqu@suse.com> wrote:
>
> [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>

Looks good, thanks.

> ---
>  common/btrfs | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/common/btrfs b/common/btrfs
> index e1b29c61..0a3f0f0b 100644
> --- a/common/btrfs
> +++ b/common/btrfs
> @@ -728,7 +728,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
>  }
>
> --
> 2.42.0
>
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] fstests: btrfs: detect regular qgroup for older kernels correctly
  2024-02-20  4:01 [PATCH] fstests: btrfs: detect regular qgroup for older kernels correctly Qu Wenruo
  2024-02-20 11:11 ` Filipe Manana
@ 2024-02-26  6:36 ` Anand Jain
  1 sibling, 0 replies; 3+ messages in thread
From: Anand Jain @ 2024-02-26  6:36 UTC (permalink / raw)
  To: Qu Wenruo, linux-btrfs, fstests

On 2/20/24 09:31, Qu Wenruo wrote:
> [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: Anand Jain <anand.jain@oracle.com>

Sorry for missing this patch. Now, applied and staged for the next PR.

Thanks.

> ---
>   common/btrfs | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/common/btrfs b/common/btrfs
> index e1b29c61..0a3f0f0b 100644
> --- a/common/btrfs
> +++ b/common/btrfs
> @@ -728,7 +728,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
>   }
>   


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-02-26  6:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-20  4:01 [PATCH] fstests: btrfs: detect regular qgroup for older kernels correctly Qu Wenruo
2024-02-20 11:11 ` Filipe Manana
2024-02-26  6:36 ` Anand Jain

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox