* [PATCH] common: fix rt_ops setup in _scratch_mkfs_sized
@ 2023-09-08 12:12 cem
2023-09-08 14:13 ` Zorro Lang
0 siblings, 1 reply; 2+ messages in thread
From: cem @ 2023-09-08 12:12 UTC (permalink / raw)
To: fstests; +Cc: zlang, linux-xfs
From: Carlos Maiolino <cem@kernel.org>
Tests using _scratch_mkfs_sized() will fail if SCRATCH_RTDEV is set,
but, USE_EXTERNAL is not, this happens because the function pass
"-r size=$fssize" to the _scratch_mkfs_xfs argument line, which in turn
will not set rtdev because USE_EXTERNAL is not set.
Tests like xfs/015 will fail as:
xfs/015 6s ... [failed, exit status 1]- output mismatch
.
.
+size specified for non-existent rt subvolume
+Usage: mkfs.xfs
.
.
with this patch the test runs properly using the rtdev if USE_EXTERNAL
is set.
Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com>
---
Particularly I think SCRATCH_RTDEV should not depend on USE_EXTERNAL, as the
latter is also linked to external logdevs, but I noticed tests specific for RT
devices also set USE_EXTERNAL, so I opted to change it according to the current
usage
common/rc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/common/rc b/common/rc
index 1618ded5..20608fbe 100644
--- a/common/rc
+++ b/common/rc
@@ -965,7 +965,7 @@ _scratch_mkfs_sized()
[ "$fssize" -gt "$devsize" ] && _notrun "Scratch device too small"
fi
- if [ "$FSTYP" = "xfs" ] && [ -b "$SCRATCH_RTDEV" ]; then
+ if [ "$FSTYP" = "xfs" ] && [ "$USE_EXTERNAL" = yes -a -b "$SCRATCH_RTDEV" ]; then
local rtdevsize=`blockdev --getsize64 $SCRATCH_RTDEV`
[ "$fssize" -gt "$rtdevsize" ] && _notrun "Scratch rt device too small"
rt_ops="-r size=$fssize"
--
2.39.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] common: fix rt_ops setup in _scratch_mkfs_sized
2023-09-08 12:12 [PATCH] common: fix rt_ops setup in _scratch_mkfs_sized cem
@ 2023-09-08 14:13 ` Zorro Lang
0 siblings, 0 replies; 2+ messages in thread
From: Zorro Lang @ 2023-09-08 14:13 UTC (permalink / raw)
To: cem; +Cc: fstests, zlang, linux-xfs
On Fri, Sep 08, 2023 at 02:12:34PM +0200, cem@kernel.org wrote:
> From: Carlos Maiolino <cem@kernel.org>
>
> Tests using _scratch_mkfs_sized() will fail if SCRATCH_RTDEV is set,
> but, USE_EXTERNAL is not, this happens because the function pass
> "-r size=$fssize" to the _scratch_mkfs_xfs argument line, which in turn
> will not set rtdev because USE_EXTERNAL is not set.
>
> Tests like xfs/015 will fail as:
>
> xfs/015 6s ... [failed, exit status 1]- output mismatch
> .
> .
> +size specified for non-existent rt subvolume
> +Usage: mkfs.xfs
> .
> .
>
> with this patch the test runs properly using the rtdev if USE_EXTERNAL
> is set.
>
> Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com>
> ---
>
> Particularly I think SCRATCH_RTDEV should not depend on USE_EXTERNAL, as the
> latter is also linked to external logdevs, but I noticed tests specific for RT
> devices also set USE_EXTERNAL, so I opted to change it according to the current
> usage
According to the fstests/README:
Extra SCRATCH device specifications:
- Set SCRATCH_LOGDEV to "device for scratch-fs external log"
- Set SCRATCH_RTDEV to "device for scratch-fs realtime data"
- If SCRATCH_LOGDEV and/or SCRATCH_RTDEV, the USE_EXTERNAL environment
So the USE_EXTERNAL should work with SCRATCH_RTDEV too. So this patch looks
good to me,
Reviewed-by: Zorro Lang <zlang@redhat.com>
>
> common/rc | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/common/rc b/common/rc
> index 1618ded5..20608fbe 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -965,7 +965,7 @@ _scratch_mkfs_sized()
> [ "$fssize" -gt "$devsize" ] && _notrun "Scratch device too small"
> fi
>
> - if [ "$FSTYP" = "xfs" ] && [ -b "$SCRATCH_RTDEV" ]; then
> + if [ "$FSTYP" = "xfs" ] && [ "$USE_EXTERNAL" = yes -a -b "$SCRATCH_RTDEV" ]; then
> local rtdevsize=`blockdev --getsize64 $SCRATCH_RTDEV`
> [ "$fssize" -gt "$rtdevsize" ] && _notrun "Scratch rt device too small"
> rt_ops="-r size=$fssize"
> --
> 2.39.2
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-09-08 14:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-08 12:12 [PATCH] common: fix rt_ops setup in _scratch_mkfs_sized cem
2023-09-08 14:13 ` Zorro Lang
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.