* [PATCH 0/2] _scratch_mkfs_sized fixes for xfs rt devices
@ 2024-10-08 10:52 Hans Holmberg
2024-10-08 10:52 ` [PATCH 1/2] common: make rt_ops local in _try_scratch_mkfs_sized Hans Holmberg
2024-10-08 10:52 ` [PATCH 2/2] xfs/157,xfs/547,xfs/548: switch to using _scratch_mkfs_sized Hans Holmberg
0 siblings, 2 replies; 9+ messages in thread
From: Hans Holmberg @ 2024-10-08 10:52 UTC (permalink / raw)
To: zlang@redhat.com, djwong@kernel.org
Cc: hch, fstests@vger.kernel.org, linux-xfs@vger.kernel.org,
Hans Holmberg
These patches fix up three failures that turned up in testing xfs in a
a zoned rt device setup, but the fixes should be applicable for
non-zoned rt testing as well.
Hans Holmberg (2):
common: make rt_ops local in _try_scratch_mkfs_sized
xfs/157,xfs/547,xfs/548: switch to using _scratch_mkfs_sized
common/rc | 1 +
tests/xfs/157 | 12 ++++++++----
tests/xfs/547 | 4 +++-
tests/xfs/548 | 2 +-
4 files changed, 13 insertions(+), 6 deletions(-)
--
2.34.1
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 1/2] common: make rt_ops local in _try_scratch_mkfs_sized
2024-10-08 10:52 [PATCH 0/2] _scratch_mkfs_sized fixes for xfs rt devices Hans Holmberg
@ 2024-10-08 10:52 ` Hans Holmberg
2024-10-08 11:34 ` hch
` (2 more replies)
2024-10-08 10:52 ` [PATCH 2/2] xfs/157,xfs/547,xfs/548: switch to using _scratch_mkfs_sized Hans Holmberg
1 sibling, 3 replies; 9+ messages in thread
From: Hans Holmberg @ 2024-10-08 10:52 UTC (permalink / raw)
To: zlang@redhat.com, djwong@kernel.org
Cc: hch, fstests@vger.kernel.org, linux-xfs@vger.kernel.org,
Hans Holmberg, Hans Holmberg
From: Hans Holmberg <Hans.Holmberg@wdc.com>
If we call _try_scratch_mkfs_size with $SCRATCH_RTDEV set followed by
a call with $SCRATCH_RTDEV cleared, rt_ops will have stale size
parameters that will cause mkfs.xfs to fail with:
"size specified for non-existent rt subvolume"
Make rt_ops local to fix this.
Signed-off-by: Hans Holmberg <hans.holmberg@wdc.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
common/rc | 1 +
1 file changed, 1 insertion(+)
diff --git a/common/rc b/common/rc
index 35738d7b6bf3..c9aae1ad0b90 100644
--- a/common/rc
+++ b/common/rc
@@ -1030,6 +1030,7 @@ _try_scratch_mkfs_sized()
local blocksize=$2
local def_blksz
local blocksize_opt
+ local rt_ops
case $FSTYP in
xfs)
--
2.34.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 2/2] xfs/157,xfs/547,xfs/548: switch to using _scratch_mkfs_sized
2024-10-08 10:52 [PATCH 0/2] _scratch_mkfs_sized fixes for xfs rt devices Hans Holmberg
2024-10-08 10:52 ` [PATCH 1/2] common: make rt_ops local in _try_scratch_mkfs_sized Hans Holmberg
@ 2024-10-08 10:52 ` Hans Holmberg
2024-10-08 17:11 ` Darrick J. Wong
2024-10-10 6:57 ` Zorro Lang
1 sibling, 2 replies; 9+ messages in thread
From: Hans Holmberg @ 2024-10-08 10:52 UTC (permalink / raw)
To: zlang@redhat.com, djwong@kernel.org
Cc: hch, fstests@vger.kernel.org, linux-xfs@vger.kernel.org,
Hans Holmberg, Hans Holmberg
From: Hans Holmberg <Hans.Holmberg@wdc.com>
These test cases specify small -d sizes which combined with a rt dev of
unrestricted size and the rtrmap feature can cause mkfs to fail with
error:
mkfs.xfs: cannot handle expansion of realtime rmap btree; need <x> free
blocks, have <y>
This is due to that the -d size is not big enough to support the
metadata space allocation required for the rt groups.
Switch to use _scratch_mkfs_sized that sets up the -r size parameter
to avoid this. If -r size=x and -d size=x we will not risk running
out of space on the ddev as the metadata size is just a fraction of
the rt data size.
Signed-off-by: Hans Holmberg <hans.holmberg@wdc.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
tests/xfs/157 | 12 ++++++++----
tests/xfs/547 | 4 +++-
tests/xfs/548 | 2 +-
3 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/tests/xfs/157 b/tests/xfs/157
index 79d45ac2bb34..9b5badbaeb3c 100755
--- a/tests/xfs/157
+++ b/tests/xfs/157
@@ -34,18 +34,21 @@ _require_test
_require_scratch_nocheck
_require_command "$XFS_ADMIN_PROG" "xfs_admin"
+
# Create some fake sparse files for testing external devices and whatnot
+fs_size=$((500 * 1024 * 1024))
+
fake_datafile=$TEST_DIR/$seq.scratch.data
rm -f $fake_datafile
-truncate -s 500m $fake_datafile
+truncate -s $fs_size $fake_datafile
fake_logfile=$TEST_DIR/$seq.scratch.log
rm -f $fake_logfile
-truncate -s 500m $fake_logfile
+truncate -s $fs_size $fake_logfile
fake_rtfile=$TEST_DIR/$seq.scratch.rt
rm -f $fake_rtfile
-truncate -s 500m $fake_rtfile
+truncate -s $fs_size $fake_rtfile
# Save the original variables
orig_ddev=$SCRATCH_DEV
@@ -63,7 +66,8 @@ scenario() {
}
check_label() {
- _scratch_mkfs -L oldlabel >> $seqres.full
+ MKFS_OPTIONS="-L oldlabel $MKFS_OPTIONS" _scratch_mkfs_sized $fs_size \
+ >> $seqres.full
_scratch_xfs_db -c label
_scratch_xfs_admin -L newlabel "$@" >> $seqres.full
_scratch_xfs_db -c label
diff --git a/tests/xfs/547 b/tests/xfs/547
index eada4aadc27f..ffac546be4cd 100755
--- a/tests/xfs/547
+++ b/tests/xfs/547
@@ -24,10 +24,12 @@ _require_xfs_db_command path
_require_test_program "punch-alternating"
_require_xfs_io_error_injection "bmap_alloc_minlen_extent"
+fs_size=$((512 * 1024 * 1024))
+
for nrext64 in 0 1; do
echo "* Verify extent counter fields with nrext64=${nrext64} option"
- _scratch_mkfs -i nrext64=${nrext64} -d size=$((512 * 1024 * 1024)) \
+ MKFS_OPTIONS="-i nrext64=${nrext64} $MKFS_OPTIONS" _scratch_mkfs_sized $fs_size \
>> $seqres.full
_scratch_mount >> $seqres.full
diff --git a/tests/xfs/548 b/tests/xfs/548
index f0b58563e64d..af72885a9c6e 100755
--- a/tests/xfs/548
+++ b/tests/xfs/548
@@ -24,7 +24,7 @@ _require_xfs_db_command path
_require_test_program "punch-alternating"
_require_xfs_io_error_injection "bmap_alloc_minlen_extent"
-_scratch_mkfs -d size=$((512 * 1024 * 1024)) >> $seqres.full
+_scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seqres.full
_scratch_mount >> $seqres.full
bsize=$(_get_file_block_size $SCRATCH_MNT)
--
2.34.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 1/2] common: make rt_ops local in _try_scratch_mkfs_sized
2024-10-08 10:52 ` [PATCH 1/2] common: make rt_ops local in _try_scratch_mkfs_sized Hans Holmberg
@ 2024-10-08 11:34 ` hch
2024-10-08 17:02 ` Darrick J. Wong
2024-10-10 6:58 ` Zorro Lang
2 siblings, 0 replies; 9+ messages in thread
From: hch @ 2024-10-08 11:34 UTC (permalink / raw)
To: Hans Holmberg
Cc: zlang@redhat.com, djwong@kernel.org, hch, fstests@vger.kernel.org,
linux-xfs@vger.kernel.org
On Tue, Oct 08, 2024 at 10:52:04AM +0000, Hans Holmberg wrote:
> From: Hans Holmberg <Hans.Holmberg@wdc.com>
>
> If we call _try_scratch_mkfs_size with $SCRATCH_RTDEV set followed by
> a call with $SCRATCH_RTDEV cleared, rt_ops will have stale size
> parameters that will cause mkfs.xfs to fail with:
> "size specified for non-existent rt subvolume"
>
> Make rt_ops local to fix this.
>
> Signed-off-by: Hans Holmberg <hans.holmberg@wdc.com>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
Note that the signoff here and for the next patch was just due to
me applying it to my staging tree. For submission feel free to turn
this into:
Reviewed-by: Christoph Hellwig <hch@lst.de>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/2] common: make rt_ops local in _try_scratch_mkfs_sized
2024-10-08 10:52 ` [PATCH 1/2] common: make rt_ops local in _try_scratch_mkfs_sized Hans Holmberg
2024-10-08 11:34 ` hch
@ 2024-10-08 17:02 ` Darrick J. Wong
2024-10-10 6:58 ` Zorro Lang
2 siblings, 0 replies; 9+ messages in thread
From: Darrick J. Wong @ 2024-10-08 17:02 UTC (permalink / raw)
To: Hans Holmberg
Cc: zlang@redhat.com, hch, fstests@vger.kernel.org,
linux-xfs@vger.kernel.org
On Tue, Oct 08, 2024 at 10:52:04AM +0000, Hans Holmberg wrote:
> From: Hans Holmberg <Hans.Holmberg@wdc.com>
>
> If we call _try_scratch_mkfs_size with $SCRATCH_RTDEV set followed by
> a call with $SCRATCH_RTDEV cleared, rt_ops will have stale size
> parameters that will cause mkfs.xfs to fail with:
> "size specified for non-existent rt subvolume"
>
> Make rt_ops local to fix this.
>
> Signed-off-by: Hans Holmberg <hans.holmberg@wdc.com>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
baaaaaaaaaaaash!
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
--D
> ---
> common/rc | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/common/rc b/common/rc
> index 35738d7b6bf3..c9aae1ad0b90 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -1030,6 +1030,7 @@ _try_scratch_mkfs_sized()
> local blocksize=$2
> local def_blksz
> local blocksize_opt
> + local rt_ops
>
> case $FSTYP in
> xfs)
> --
> 2.34.1
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 2/2] xfs/157,xfs/547,xfs/548: switch to using _scratch_mkfs_sized
2024-10-08 10:52 ` [PATCH 2/2] xfs/157,xfs/547,xfs/548: switch to using _scratch_mkfs_sized Hans Holmberg
@ 2024-10-08 17:11 ` Darrick J. Wong
2024-10-09 6:45 ` Hans Holmberg
2024-10-10 6:57 ` Zorro Lang
1 sibling, 1 reply; 9+ messages in thread
From: Darrick J. Wong @ 2024-10-08 17:11 UTC (permalink / raw)
To: Hans Holmberg
Cc: zlang@redhat.com, hch, fstests@vger.kernel.org,
linux-xfs@vger.kernel.org
On Tue, Oct 08, 2024 at 10:52:04AM +0000, Hans Holmberg wrote:
> From: Hans Holmberg <Hans.Holmberg@wdc.com>
>
> These test cases specify small -d sizes which combined with a rt dev of
> unrestricted size and the rtrmap feature can cause mkfs to fail with
> error:
>
> mkfs.xfs: cannot handle expansion of realtime rmap btree; need <x> free
> blocks, have <y>
>
> This is due to that the -d size is not big enough to support the
> metadata space allocation required for the rt groups.
>
> Switch to use _scratch_mkfs_sized that sets up the -r size parameter
> to avoid this. If -r size=x and -d size=x we will not risk running
> out of space on the ddev as the metadata size is just a fraction of
> the rt data size.
>
> Signed-off-by: Hans Holmberg <hans.holmberg@wdc.com>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
> tests/xfs/157 | 12 ++++++++----
> tests/xfs/547 | 4 +++-
> tests/xfs/548 | 2 +-
> 3 files changed, 12 insertions(+), 6 deletions(-)
>
> diff --git a/tests/xfs/157 b/tests/xfs/157
> index 79d45ac2bb34..9b5badbaeb3c 100755
> --- a/tests/xfs/157
> +++ b/tests/xfs/157
> @@ -34,18 +34,21 @@ _require_test
> _require_scratch_nocheck
> _require_command "$XFS_ADMIN_PROG" "xfs_admin"
>
> +
> # Create some fake sparse files for testing external devices and whatnot
> +fs_size=$((500 * 1024 * 1024))
> +
> fake_datafile=$TEST_DIR/$seq.scratch.data
> rm -f $fake_datafile
> -truncate -s 500m $fake_datafile
> +truncate -s $fs_size $fake_datafile
>
> fake_logfile=$TEST_DIR/$seq.scratch.log
> rm -f $fake_logfile
> -truncate -s 500m $fake_logfile
> +truncate -s $fs_size $fake_logfile
>
> fake_rtfile=$TEST_DIR/$seq.scratch.rt
> rm -f $fake_rtfile
> -truncate -s 500m $fake_rtfile
> +truncate -s $fs_size $fake_rtfile
>
> # Save the original variables
> orig_ddev=$SCRATCH_DEV
> @@ -63,7 +66,8 @@ scenario() {
> }
>
> check_label() {
> - _scratch_mkfs -L oldlabel >> $seqres.full
> + MKFS_OPTIONS="-L oldlabel $MKFS_OPTIONS" _scratch_mkfs_sized $fs_size \
> + >> $seqres.full
I was surprised that this was necessary until I remembered that this
test checks various *combinations* of block devices and 500M files.
The block device can be quite large, so that's why you want
_scratch_mkfs_sized to force the size of both sections to 500M.
Heh, oops. My bad, I should have caught that. :(
> _scratch_xfs_db -c label
> _scratch_xfs_admin -L newlabel "$@" >> $seqres.full
> _scratch_xfs_db -c label
> diff --git a/tests/xfs/547 b/tests/xfs/547
> index eada4aadc27f..ffac546be4cd 100755
> --- a/tests/xfs/547
> +++ b/tests/xfs/547
> @@ -24,10 +24,12 @@ _require_xfs_db_command path
> _require_test_program "punch-alternating"
> _require_xfs_io_error_injection "bmap_alloc_minlen_extent"
>
> +fs_size=$((512 * 1024 * 1024))
> +
> for nrext64 in 0 1; do
> echo "* Verify extent counter fields with nrext64=${nrext64} option"
>
> - _scratch_mkfs -i nrext64=${nrext64} -d size=$((512 * 1024 * 1024)) \
> + MKFS_OPTIONS="-i nrext64=${nrext64} $MKFS_OPTIONS" _scratch_mkfs_sized $fs_size \
> >> $seqres.full
> _scratch_mount >> $seqres.full
>
> diff --git a/tests/xfs/548 b/tests/xfs/548
> index f0b58563e64d..af72885a9c6e 100755
> --- a/tests/xfs/548
> +++ b/tests/xfs/548
> @@ -24,7 +24,7 @@ _require_xfs_db_command path
> _require_test_program "punch-alternating"
> _require_xfs_io_error_injection "bmap_alloc_minlen_extent"
>
> -_scratch_mkfs -d size=$((512 * 1024 * 1024)) >> $seqres.full
> +_scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seqres.full
These other two are pretty self evident so
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
--D
> _scratch_mount >> $seqres.full
>
> bsize=$(_get_file_block_size $SCRATCH_MNT)
> --
> 2.34.1
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 2/2] xfs/157,xfs/547,xfs/548: switch to using _scratch_mkfs_sized
2024-10-08 17:11 ` Darrick J. Wong
@ 2024-10-09 6:45 ` Hans Holmberg
0 siblings, 0 replies; 9+ messages in thread
From: Hans Holmberg @ 2024-10-09 6:45 UTC (permalink / raw)
To: Darrick J. Wong
Cc: zlang@redhat.com, hch, fstests@vger.kernel.org,
linux-xfs@vger.kernel.org
On 08/10/2024 19:11, Darrick J. Wong wrote:
> On Tue, Oct 08, 2024 at 10:52:04AM +0000, Hans Holmberg wrote:
>> From: Hans Holmberg <Hans.Holmberg@wdc.com>
>>
>> These test cases specify small -d sizes which combined with a rt dev of
>> unrestricted size and the rtrmap feature can cause mkfs to fail with
>> error:
>>
>> mkfs.xfs: cannot handle expansion of realtime rmap btree; need <x> free
>> blocks, have <y>
>>
>> This is due to that the -d size is not big enough to support the
>> metadata space allocation required for the rt groups.
>>
>> Switch to use _scratch_mkfs_sized that sets up the -r size parameter
>> to avoid this. If -r size=x and -d size=x we will not risk running
>> out of space on the ddev as the metadata size is just a fraction of
>> the rt data size.
>>
>> Signed-off-by: Hans Holmberg <hans.holmberg@wdc.com>
>> Signed-off-by: Christoph Hellwig <hch@lst.de>
>> ---
>> tests/xfs/157 | 12 ++++++++----
>> tests/xfs/547 | 4 +++-
>> tests/xfs/548 | 2 +-
>> 3 files changed, 12 insertions(+), 6 deletions(-)
>>
>> diff --git a/tests/xfs/157 b/tests/xfs/157
>> index 79d45ac2bb34..9b5badbaeb3c 100755
>> --- a/tests/xfs/157
>> +++ b/tests/xfs/157
>> @@ -34,18 +34,21 @@ _require_test
>> _require_scratch_nocheck
>> _require_command "$XFS_ADMIN_PROG" "xfs_admin"
>>
>> +
>> # Create some fake sparse files for testing external devices and whatnot
>> +fs_size=$((500 * 1024 * 1024))
>> +
>> fake_datafile=$TEST_DIR/$seq.scratch.data
>> rm -f $fake_datafile
>> -truncate -s 500m $fake_datafile
>> +truncate -s $fs_size $fake_datafile
>>
>> fake_logfile=$TEST_DIR/$seq.scratch.log
>> rm -f $fake_logfile
>> -truncate -s 500m $fake_logfile
>> +truncate -s $fs_size $fake_logfile
>>
>> fake_rtfile=$TEST_DIR/$seq.scratch.rt
>> rm -f $fake_rtfile
>> -truncate -s 500m $fake_rtfile
>> +truncate -s $fs_size $fake_rtfile
>>
>> # Save the original variables
>> orig_ddev=$SCRATCH_DEV
>> @@ -63,7 +66,8 @@ scenario() {
>> }
>>
>> check_label() {
>> - _scratch_mkfs -L oldlabel >> $seqres.full
>> + MKFS_OPTIONS="-L oldlabel $MKFS_OPTIONS" _scratch_mkfs_sized $fs_size \
>> + >> $seqres.full
>
> I was surprised that this was necessary until I remembered that this
> test checks various *combinations* of block devices and 500M files.
> The block device can be quite large, so that's why you want
> _scratch_mkfs_sized to force the size of both sections to 500M.
Yeah, exactly.
> Heh, oops. My bad, I should have caught that. :(
This was a tricky one, but the fix straight-forward :)
Thanks,
Hans
>
>> _scratch_xfs_db -c label
>> _scratch_xfs_admin -L newlabel "$@" >> $seqres.full
>> _scratch_xfs_db -c label
>> diff --git a/tests/xfs/547 b/tests/xfs/547
>> index eada4aadc27f..ffac546be4cd 100755
>> --- a/tests/xfs/547
>> +++ b/tests/xfs/547
>> @@ -24,10 +24,12 @@ _require_xfs_db_command path
>> _require_test_program "punch-alternating"
>> _require_xfs_io_error_injection "bmap_alloc_minlen_extent"
>>
>> +fs_size=$((512 * 1024 * 1024))
>> +
>> for nrext64 in 0 1; do
>> echo "* Verify extent counter fields with nrext64=${nrext64} option"
>>
>> - _scratch_mkfs -i nrext64=${nrext64} -d size=$((512 * 1024 * 1024)) \
>> + MKFS_OPTIONS="-i nrext64=${nrext64} $MKFS_OPTIONS" _scratch_mkfs_sized $fs_size \
>> >> $seqres.full
>> _scratch_mount >> $seqres.full
>>
>> diff --git a/tests/xfs/548 b/tests/xfs/548
>> index f0b58563e64d..af72885a9c6e 100755
>> --- a/tests/xfs/548
>> +++ b/tests/xfs/548
>> @@ -24,7 +24,7 @@ _require_xfs_db_command path
>> _require_test_program "punch-alternating"
>> _require_xfs_io_error_injection "bmap_alloc_minlen_extent"
>>
>> -_scratch_mkfs -d size=$((512 * 1024 * 1024)) >> $seqres.full
>> +_scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seqres.full
>
> These other two are pretty self evident so
> Reviewed-by: Darrick J. Wong <djwong@kernel.org>
>
> --D
>
>> _scratch_mount >> $seqres.full
>>
>> bsize=$(_get_file_block_size $SCRATCH_MNT)
>> --
>> 2.34.1
>>
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 2/2] xfs/157,xfs/547,xfs/548: switch to using _scratch_mkfs_sized
2024-10-08 10:52 ` [PATCH 2/2] xfs/157,xfs/547,xfs/548: switch to using _scratch_mkfs_sized Hans Holmberg
2024-10-08 17:11 ` Darrick J. Wong
@ 2024-10-10 6:57 ` Zorro Lang
1 sibling, 0 replies; 9+ messages in thread
From: Zorro Lang @ 2024-10-10 6:57 UTC (permalink / raw)
To: Hans Holmberg
Cc: zlang@redhat.com, djwong@kernel.org, hch, fstests@vger.kernel.org,
linux-xfs@vger.kernel.org
On Tue, Oct 08, 2024 at 10:52:04AM +0000, Hans Holmberg wrote:
> From: Hans Holmberg <Hans.Holmberg@wdc.com>
>
> These test cases specify small -d sizes which combined with a rt dev of
> unrestricted size and the rtrmap feature can cause mkfs to fail with
> error:
>
> mkfs.xfs: cannot handle expansion of realtime rmap btree; need <x> free
> blocks, have <y>
>
> This is due to that the -d size is not big enough to support the
> metadata space allocation required for the rt groups.
>
> Switch to use _scratch_mkfs_sized that sets up the -r size parameter
> to avoid this. If -r size=x and -d size=x we will not risk running
> out of space on the ddev as the metadata size is just a fraction of
> the rt data size.
>
> Signed-off-by: Hans Holmberg <hans.holmberg@wdc.com>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
> tests/xfs/157 | 12 ++++++++----
> tests/xfs/547 | 4 +++-
> tests/xfs/548 | 2 +-
> 3 files changed, 12 insertions(+), 6 deletions(-)
>
> diff --git a/tests/xfs/157 b/tests/xfs/157
> index 79d45ac2bb34..9b5badbaeb3c 100755
> --- a/tests/xfs/157
> +++ b/tests/xfs/157
> @@ -34,18 +34,21 @@ _require_test
> _require_scratch_nocheck
> _require_command "$XFS_ADMIN_PROG" "xfs_admin"
>
> +
> # Create some fake sparse files for testing external devices and whatnot
> +fs_size=$((500 * 1024 * 1024))
> +
> fake_datafile=$TEST_DIR/$seq.scratch.data
> rm -f $fake_datafile
> -truncate -s 500m $fake_datafile
> +truncate -s $fs_size $fake_datafile
>
> fake_logfile=$TEST_DIR/$seq.scratch.log
> rm -f $fake_logfile
> -truncate -s 500m $fake_logfile
> +truncate -s $fs_size $fake_logfile
>
> fake_rtfile=$TEST_DIR/$seq.scratch.rt
> rm -f $fake_rtfile
> -truncate -s 500m $fake_rtfile
> +truncate -s $fs_size $fake_rtfile
>
> # Save the original variables
> orig_ddev=$SCRATCH_DEV
> @@ -63,7 +66,8 @@ scenario() {
> }
>
> check_label() {
> - _scratch_mkfs -L oldlabel >> $seqres.full
> + MKFS_OPTIONS="-L oldlabel $MKFS_OPTIONS" _scratch_mkfs_sized $fs_size \
> + >> $seqres.full
Currently _scratch_mkfs_sized will _notrun if fails, but _scratch_mkfs doesn't.
So _scratch_mkfs might be similar with _try_scratch_mkfs_sized (returns fail).
But for this patch, both make sense to me.
Reviewed-by: Zorro Lang <zlang@redhat.com>
> _scratch_xfs_db -c label
> _scratch_xfs_admin -L newlabel "$@" >> $seqres.full
> _scratch_xfs_db -c label
> diff --git a/tests/xfs/547 b/tests/xfs/547
> index eada4aadc27f..ffac546be4cd 100755
> --- a/tests/xfs/547
> +++ b/tests/xfs/547
> @@ -24,10 +24,12 @@ _require_xfs_db_command path
> _require_test_program "punch-alternating"
> _require_xfs_io_error_injection "bmap_alloc_minlen_extent"
>
> +fs_size=$((512 * 1024 * 1024))
> +
> for nrext64 in 0 1; do
> echo "* Verify extent counter fields with nrext64=${nrext64} option"
>
> - _scratch_mkfs -i nrext64=${nrext64} -d size=$((512 * 1024 * 1024)) \
> + MKFS_OPTIONS="-i nrext64=${nrext64} $MKFS_OPTIONS" _scratch_mkfs_sized $fs_size \
> >> $seqres.full
> _scratch_mount >> $seqres.full
>
> diff --git a/tests/xfs/548 b/tests/xfs/548
> index f0b58563e64d..af72885a9c6e 100755
> --- a/tests/xfs/548
> +++ b/tests/xfs/548
> @@ -24,7 +24,7 @@ _require_xfs_db_command path
> _require_test_program "punch-alternating"
> _require_xfs_io_error_injection "bmap_alloc_minlen_extent"
>
> -_scratch_mkfs -d size=$((512 * 1024 * 1024)) >> $seqres.full
> +_scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seqres.full
> _scratch_mount >> $seqres.full
>
> bsize=$(_get_file_block_size $SCRATCH_MNT)
> --
> 2.34.1
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/2] common: make rt_ops local in _try_scratch_mkfs_sized
2024-10-08 10:52 ` [PATCH 1/2] common: make rt_ops local in _try_scratch_mkfs_sized Hans Holmberg
2024-10-08 11:34 ` hch
2024-10-08 17:02 ` Darrick J. Wong
@ 2024-10-10 6:58 ` Zorro Lang
2 siblings, 0 replies; 9+ messages in thread
From: Zorro Lang @ 2024-10-10 6:58 UTC (permalink / raw)
To: Hans Holmberg
Cc: zlang@redhat.com, djwong@kernel.org, hch, fstests@vger.kernel.org,
linux-xfs@vger.kernel.org
On Tue, Oct 08, 2024 at 10:52:04AM +0000, Hans Holmberg wrote:
> From: Hans Holmberg <Hans.Holmberg@wdc.com>
>
> If we call _try_scratch_mkfs_size with $SCRATCH_RTDEV set followed by
> a call with $SCRATCH_RTDEV cleared, rt_ops will have stale size
> parameters that will cause mkfs.xfs to fail with:
> "size specified for non-existent rt subvolume"
>
> Make rt_ops local to fix this.
Hahahha, local and export issue again :)
Reviewed-by: Zorro Lang <zlang@redhat.com>
>
> Signed-off-by: Hans Holmberg <hans.holmberg@wdc.com>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
> common/rc | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/common/rc b/common/rc
> index 35738d7b6bf3..c9aae1ad0b90 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -1030,6 +1030,7 @@ _try_scratch_mkfs_sized()
> local blocksize=$2
> local def_blksz
> local blocksize_opt
> + local rt_ops
>
> case $FSTYP in
> xfs)
> --
> 2.34.1
>
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2024-10-10 6:58 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-08 10:52 [PATCH 0/2] _scratch_mkfs_sized fixes for xfs rt devices Hans Holmberg
2024-10-08 10:52 ` [PATCH 1/2] common: make rt_ops local in _try_scratch_mkfs_sized Hans Holmberg
2024-10-08 11:34 ` hch
2024-10-08 17:02 ` Darrick J. Wong
2024-10-10 6:58 ` Zorro Lang
2024-10-08 10:52 ` [PATCH 2/2] xfs/157,xfs/547,xfs/548: switch to using _scratch_mkfs_sized Hans Holmberg
2024-10-08 17:11 ` Darrick J. Wong
2024-10-09 6:45 ` Hans Holmberg
2024-10-10 6:57 ` Zorro Lang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox