public inbox for fstests@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] btrfs/172,206: call _log_writes_cleanup in _cleanup
@ 2024-02-16 10:25 Su Yue
  2024-02-25 16:22 ` Zorro Lang
  0 siblings, 1 reply; 3+ messages in thread
From: Su Yue @ 2024-02-16 10:25 UTC (permalink / raw)
  To: fstests; +Cc: linux-btrfs, l, Su Yue, Filipe Manana, Qu Wenruo

From: Su Yue <glass.su@suse.com>

Because block group tree requires require no-holes feature,
_log_writes_mkfs "-O ^no-holes" fails when "-O block-group-tree" is
given in MKFS_OPTION.
Without explicit _log_writes_cleanup, the two tests fail with
logwrites-test device left. And all next tests will fail due to
SCRATCH DEVICE EBUSY.

Fix it by overriding _cleanup to call _log_writes_cleanup.

Signed-off-by: Su Yue <glass.su@suse.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
---
changelog:
v2:
    Remove unneeded comments for _cleanup.
    Add rvbs.
---
 tests/btrfs/172 | 5 +++++
 tests/btrfs/206 | 5 +++++
 2 files changed, 10 insertions(+)

diff --git a/tests/btrfs/172 b/tests/btrfs/172
index f5acc6982cd7..e5e16681ec21 100755
--- a/tests/btrfs/172
+++ b/tests/btrfs/172
@@ -13,6 +13,11 @@
 . ./common/preamble
 _begin_fstest auto quick log replay recoveryloop
 
+_cleanup()
+{
+	_log_writes_cleanup &> /dev/null
+}
+
 # Import common functions.
 . ./common/filter
 . ./common/dmlogwrites
diff --git a/tests/btrfs/206 b/tests/btrfs/206
index f6571649076f..d9ce33b659e7 100755
--- a/tests/btrfs/206
+++ b/tests/btrfs/206
@@ -14,6 +14,11 @@
 . ./common/preamble
 _begin_fstest auto quick log replay recoveryloop punch prealloc
 
+_cleanup()
+{
+	_log_writes_cleanup &> /dev/null
+}
+
 # Import common functions.
 . ./common/filter
 . ./common/dmlogwrites
-- 
2.43.0


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

* Re: [PATCH v2] btrfs/172,206: call _log_writes_cleanup in _cleanup
  2024-02-16 10:25 [PATCH v2] btrfs/172,206: call _log_writes_cleanup in _cleanup Su Yue
@ 2024-02-25 16:22 ` Zorro Lang
  2024-03-07  4:03   ` Su Yue
  0 siblings, 1 reply; 3+ messages in thread
From: Zorro Lang @ 2024-02-25 16:22 UTC (permalink / raw)
  To: Su Yue; +Cc: fstests, linux-btrfs, l, Filipe Manana, Qu Wenruo

On Fri, Feb 16, 2024 at 06:25:50PM +0800, Su Yue wrote:
> From: Su Yue <glass.su@suse.com>
> 
> Because block group tree requires require no-holes feature,
> _log_writes_mkfs "-O ^no-holes" fails when "-O block-group-tree" is
> given in MKFS_OPTION.
> Without explicit _log_writes_cleanup, the two tests fail with
> logwrites-test device left. And all next tests will fail due to
> SCRATCH DEVICE EBUSY.
> 
> Fix it by overriding _cleanup to call _log_writes_cleanup.
> 
> Signed-off-by: Su Yue <glass.su@suse.com>
> Reviewed-by: Filipe Manana <fdmanana@suse.com>
> Reviewed-by: Qu Wenruo <wqu@suse.com>
> ---
> changelog:
> v2:
>     Remove unneeded comments for _cleanup.
>     Add rvbs.
> ---
>  tests/btrfs/172 | 5 +++++
>  tests/btrfs/206 | 5 +++++
>  2 files changed, 10 insertions(+)
> 
> diff --git a/tests/btrfs/172 b/tests/btrfs/172
> index f5acc6982cd7..e5e16681ec21 100755
> --- a/tests/btrfs/172
> +++ b/tests/btrfs/172
> @@ -13,6 +13,11 @@
>  . ./common/preamble
>  _begin_fstest auto quick log replay recoveryloop
>  
> +_cleanup()
> +{
> +	_log_writes_cleanup &> /dev/null

Currently we need to copy the code in default _cleanup into new _cleanup()
function, if you need a override, e.g.

        cd /
        _log_writes_cleanup
        rm -f $tmp.*

> +}
> +
>  # Import common functions.
>  . ./common/filter
>  . ./common/dmlogwrites
> diff --git a/tests/btrfs/206 b/tests/btrfs/206
> index f6571649076f..d9ce33b659e7 100755
> --- a/tests/btrfs/206
> +++ b/tests/btrfs/206
> @@ -14,6 +14,11 @@
>  . ./common/preamble
>  _begin_fstest auto quick log replay recoveryloop punch prealloc
>  
> +_cleanup()
> +{
> +	_log_writes_cleanup &> /dev/null
> +}
> +
>  # Import common functions.
>  . ./common/filter
>  . ./common/dmlogwrites
> -- 
> 2.43.0
> 
> 


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

* Re: [PATCH v2] btrfs/172,206: call _log_writes_cleanup in _cleanup
  2024-02-25 16:22 ` Zorro Lang
@ 2024-03-07  4:03   ` Su Yue
  0 siblings, 0 replies; 3+ messages in thread
From: Su Yue @ 2024-03-07  4:03 UTC (permalink / raw)
  To: Zorro Lang; +Cc: Su Yue, fstests, linux-btrfs, l, Filipe Manana, Qu Wenruo


On Mon 26 Feb 2024 at 00:22, Zorro Lang <zlang@redhat.com> wrote:

> On Fri, Feb 16, 2024 at 06:25:50PM +0800, Su Yue wrote:
>> From: Su Yue <glass.su@suse.com>
>>
>> Because block group tree requires require no-holes feature,
>> _log_writes_mkfs "-O ^no-holes" fails when "-O 
>> block-group-tree" is
>> given in MKFS_OPTION.
>> Without explicit _log_writes_cleanup, the two tests fail with
>> logwrites-test device left. And all next tests will fail due to
>> SCRATCH DEVICE EBUSY.
>>
>> Fix it by overriding _cleanup to call _log_writes_cleanup.
>>
>> Signed-off-by: Su Yue <glass.su@suse.com>
>> Reviewed-by: Filipe Manana <fdmanana@suse.com>
>> Reviewed-by: Qu Wenruo <wqu@suse.com>
>> ---
>> changelog:
>> v2:
>>     Remove unneeded comments for _cleanup.
>>     Add rvbs.
>> ---
>>  tests/btrfs/172 | 5 +++++
>>  tests/btrfs/206 | 5 +++++
>>  2 files changed, 10 insertions(+)
>>
>> diff --git a/tests/btrfs/172 b/tests/btrfs/172
>> index f5acc6982cd7..e5e16681ec21 100755
>> --- a/tests/btrfs/172
>> +++ b/tests/btrfs/172
>> @@ -13,6 +13,11 @@
>>  . ./common/preamble
>>  _begin_fstest auto quick log replay recoveryloop
>>
>> +_cleanup()
>> +{
>> +	_log_writes_cleanup &> /dev/null
>
> Currently we need to copy the code in default _cleanup into new 
> _cleanup()
> function, if you need a override, e.g.
>

Sorry for the late reply, I was working on other things with 
headache.
I saw the cleanup thing you mentioned in v1 thread. v3 was sent. 
Thanks.

--
Su

>         cd /
>         _log_writes_cleanup
>         rm -f $tmp.*
>
>> +}
>> +
>>  # Import common functions.
>>  . ./common/filter
>>  . ./common/dmlogwrites
>> diff --git a/tests/btrfs/206 b/tests/btrfs/206
>> index f6571649076f..d9ce33b659e7 100755
>> --- a/tests/btrfs/206
>> +++ b/tests/btrfs/206
>> @@ -14,6 +14,11 @@
>>  . ./common/preamble
>>  _begin_fstest auto quick log replay recoveryloop punch 
>>  prealloc
>>
>> +_cleanup()
>> +{
>> +	_log_writes_cleanup &> /dev/null
>> +}
>> +
>>  # Import common functions.
>>  . ./common/filter
>>  . ./common/dmlogwrites
>> --
>> 2.43.0
>>
>>

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

end of thread, other threads:[~2024-03-07  4:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-16 10:25 [PATCH v2] btrfs/172,206: call _log_writes_cleanup in _cleanup Su Yue
2024-02-25 16:22 ` Zorro Lang
2024-03-07  4:03   ` Su Yue

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