public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] fstests: cleanup duplicate initialization and avoid writing to .full
@ 2025-05-24  3:57 Anand Jain
  2025-05-24  3:57 ` [PATCH 1/2] fstests: remove duplicate initialization in the testcase Anand Jain
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Anand Jain @ 2025-05-24  3:57 UTC (permalink / raw)
  To: fstests; +Cc: linux-btrfs, zlang, djwong

Patch 1/2 removes duplicate initialization and unnecessary comments from
the test template.
Patch 2/2, sent earlier [1], initializes seqres early to avoid writing to
.full.

[1]
https://patchwork.kernel.org/project/linux-btrfs/patch/12a741fc7606f1b1e13524b9ee745456feade656.1744183008.git.anand.jain@oracle.com/

Anand Jain (2):
  fstests: remove duplicate initialization in the testcase
  fstests: check: fix unset seqres in run_section()

 check           |  2 +-
 tests/btrfs/253 |  3 ---
 tests/ext4/053  | 10 ----------
 3 files changed, 1 insertion(+), 14 deletions(-)

-- 
2.49.0


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

* [PATCH 1/2] fstests: remove duplicate initialization in the testcase
  2025-05-24  3:57 [PATCH 0/2] fstests: cleanup duplicate initialization and avoid writing to .full Anand Jain
@ 2025-05-24  3:57 ` Anand Jain
  2025-07-01 14:15   ` Zorro Lang
  2025-05-24  3:57 ` [PATCH 2/2] fstests: check: fix unset seqres in run_section() Anand Jain
  2025-07-01 10:02 ` [PATCH 0/2] fstests: cleanup duplicate initialization and avoid writing to .full Anand Jain
  2 siblings, 1 reply; 6+ messages in thread
From: Anand Jain @ 2025-05-24  3:57 UTC (permalink / raw)
  To: fstests; +Cc: linux-btrfs, zlang, djwong

_begin_fstest() already initializes several variables, including `seq` and
`seqres`, so remove those redundant initializations from the testcase.

Also, ext4/053 unnecessarily re-initializes `here`, `tmp`, and `status`,
which `_begin_fstest` already handles. Remove those as well.

and remove template comment.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
 tests/btrfs/253 |  3 ---
 tests/ext4/053  | 10 ----------
 2 files changed, 13 deletions(-)

diff --git a/tests/btrfs/253 b/tests/btrfs/253
index 96ab140f1780..a0cc9b55de69 100755
--- a/tests/btrfs/253
+++ b/tests/btrfs/253
@@ -28,9 +28,6 @@
 . ./common/sysfs
 _begin_fstest auto
 
-seq=`basename $0`
-seqres="${RESULT_DIR}/${seq}"
-
 # Parse a size string which is in the format "XX.XXMib".
 #
 # Parameters:
diff --git a/tests/ext4/053 b/tests/ext4/053
index 77b3ac8171f0..55f337b48355 100755
--- a/tests/ext4/053
+++ b/tests/ext4/053
@@ -9,12 +9,6 @@
 . ./common/preamble
 _begin_fstest auto mount
 
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-
-here=`pwd`
-tmp=/tmp/$$
-status=1	# failure is the default!
 trap "_cleanup; exit \$status" 0 1 2 3 15
 
 _cleanup()
@@ -27,13 +21,9 @@ _cleanup()
 	rm -f $tmp.*
 }
 
-# get standard environment, filters and checks
 . ./common/filter
 . ./common/quota
 
-# remove previous $seqres.full before test
-rm -f $seqres.full
-
 echo "Silence is golden."
 
 SIZE=$((1024 * 1024))	# 1GB in KB
-- 
2.49.0


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

* [PATCH 2/2] fstests: check: fix unset seqres in run_section()
  2025-05-24  3:57 [PATCH 0/2] fstests: cleanup duplicate initialization and avoid writing to .full Anand Jain
  2025-05-24  3:57 ` [PATCH 1/2] fstests: remove duplicate initialization in the testcase Anand Jain
@ 2025-05-24  3:57 ` Anand Jain
  2025-07-01 14:28   ` Zorro Lang
  2025-07-01 10:02 ` [PATCH 0/2] fstests: cleanup duplicate initialization and avoid writing to .full Anand Jain
  2 siblings, 1 reply; 6+ messages in thread
From: Anand Jain @ 2025-05-24  3:57 UTC (permalink / raw)
  To: fstests; +Cc: linux-btrfs, zlang, djwong

While testing, I saw that ".full" is created by _scratch_unmount(), called here:

 725 function run_section()
 ::
 815         if [ ! -z "$SCRATCH_DEV" ]; then
 816           _scratch_unmount 2> /dev/null
 817           # call the overridden mkfs - make sure the FS is built

Ensure seqres is set early in run_section() as a fix.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
This patch was sent earlier; it now addresses review comments and includes
an updated git commit log, no code changes.
  https://patchwork.kernel.org/project/linux-btrfs/patch/12a741fc7606f1b1e13524b9ee745456feade656.1744183008.git.anand.jain@oracle.com/

 check | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/check b/check
index ede54f6987bc..93d8a6cd3237 100755
--- a/check
+++ b/check
@@ -794,6 +794,7 @@ function run_section()
 
 	seq="check.$$"
 	check="$RESULT_BASE/check"
+	seqres="$check"
 
 	# don't leave old full output behind on a clean run
 	rm -f $check.full
@@ -835,7 +836,6 @@ function run_section()
 	  fi
 	fi
 
-	seqres="$check"
 	_check_test_fs
 
 	loop_status=()	# track rerun-on-failure state
-- 
2.49.0


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

* Re: [PATCH 0/2] fstests: cleanup duplicate initialization and avoid writing to .full
  2025-05-24  3:57 [PATCH 0/2] fstests: cleanup duplicate initialization and avoid writing to .full Anand Jain
  2025-05-24  3:57 ` [PATCH 1/2] fstests: remove duplicate initialization in the testcase Anand Jain
  2025-05-24  3:57 ` [PATCH 2/2] fstests: check: fix unset seqres in run_section() Anand Jain
@ 2025-07-01 10:02 ` Anand Jain
  2 siblings, 0 replies; 6+ messages in thread
From: Anand Jain @ 2025-07-01 10:02 UTC (permalink / raw)
  To: zlang; +Cc: linux-btrfs, djwong, fstests


Zorro, just a gentle ping on this patchset.

Thanks.

On 24/5/25 11:57, Anand Jain wrote:
> Patch 1/2 removes duplicate initialization and unnecessary comments from
> the test template.
> Patch 2/2, sent earlier [1], initializes seqres early to avoid writing to
> .full.
> 
> [1]
> https://patchwork.kernel.org/project/linux-btrfs/patch/12a741fc7606f1b1e13524b9ee745456feade656.1744183008.git.anand.jain@oracle.com/
> 
> Anand Jain (2):
>    fstests: remove duplicate initialization in the testcase
>    fstests: check: fix unset seqres in run_section()
> 
>   check           |  2 +-
>   tests/btrfs/253 |  3 ---
>   tests/ext4/053  | 10 ----------
>   3 files changed, 1 insertion(+), 14 deletions(-)
> 


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

* Re: [PATCH 1/2] fstests: remove duplicate initialization in the testcase
  2025-05-24  3:57 ` [PATCH 1/2] fstests: remove duplicate initialization in the testcase Anand Jain
@ 2025-07-01 14:15   ` Zorro Lang
  0 siblings, 0 replies; 6+ messages in thread
From: Zorro Lang @ 2025-07-01 14:15 UTC (permalink / raw)
  To: Anand Jain; +Cc: fstests, linux-btrfs, djwong

On Sat, May 24, 2025 at 11:57:13AM +0800, Anand Jain wrote:
> _begin_fstest() already initializes several variables, including `seq` and
> `seqres`, so remove those redundant initializations from the testcase.
> 
> Also, ext4/053 unnecessarily re-initializes `here`, `tmp`, and `status`,
> which `_begin_fstest` already handles. Remove those as well.
> 
> and remove template comment.
> 
> Signed-off-by: Anand Jain <anand.jain@oracle.com>
> ---

Thanks for cleaning up these redundant codes,

Reviewed-by: Zorro Lang <zlang@redhat.com>

>  tests/btrfs/253 |  3 ---
>  tests/ext4/053  | 10 ----------
>  2 files changed, 13 deletions(-)
> 
> diff --git a/tests/btrfs/253 b/tests/btrfs/253
> index 96ab140f1780..a0cc9b55de69 100755
> --- a/tests/btrfs/253
> +++ b/tests/btrfs/253
> @@ -28,9 +28,6 @@
>  . ./common/sysfs
>  _begin_fstest auto
>  
> -seq=`basename $0`
> -seqres="${RESULT_DIR}/${seq}"
> -
>  # Parse a size string which is in the format "XX.XXMib".
>  #
>  # Parameters:
> diff --git a/tests/ext4/053 b/tests/ext4/053
> index 77b3ac8171f0..55f337b48355 100755
> --- a/tests/ext4/053
> +++ b/tests/ext4/053
> @@ -9,12 +9,6 @@
>  . ./common/preamble
>  _begin_fstest auto mount
>  
> -seq=`basename $0`
> -seqres=$RESULT_DIR/$seq
> -
> -here=`pwd`
> -tmp=/tmp/$$
> -status=1	# failure is the default!
>  trap "_cleanup; exit \$status" 0 1 2 3 15
>  
>  _cleanup()
> @@ -27,13 +21,9 @@ _cleanup()
>  	rm -f $tmp.*
>  }
>  
> -# get standard environment, filters and checks
>  . ./common/filter
>  . ./common/quota
>  
> -# remove previous $seqres.full before test
> -rm -f $seqres.full
> -
>  echo "Silence is golden."
>  
>  SIZE=$((1024 * 1024))	# 1GB in KB
> -- 
> 2.49.0
> 


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

* Re: [PATCH 2/2] fstests: check: fix unset seqres in run_section()
  2025-05-24  3:57 ` [PATCH 2/2] fstests: check: fix unset seqres in run_section() Anand Jain
@ 2025-07-01 14:28   ` Zorro Lang
  0 siblings, 0 replies; 6+ messages in thread
From: Zorro Lang @ 2025-07-01 14:28 UTC (permalink / raw)
  To: Anand Jain; +Cc: fstests, linux-btrfs, djwong

On Sat, May 24, 2025 at 11:57:14AM +0800, Anand Jain wrote:
> While testing, I saw that ".full" is created by _scratch_unmount(), called here:
> 
>  725 function run_section()
>  ::
>  815         if [ ! -z "$SCRATCH_DEV" ]; then
>  816           _scratch_unmount 2> /dev/null
>  817           # call the overridden mkfs - make sure the FS is built
> 
> Ensure seqres is set early in run_section() as a fix.
> 
> Signed-off-by: Anand Jain <anand.jain@oracle.com>
> ---

Reviewed-by: Zorro Lang <zlang@redhat.com>

> This patch was sent earlier; it now addresses review comments and includes
> an updated git commit log, no code changes.
>   https://patchwork.kernel.org/project/linux-btrfs/patch/12a741fc7606f1b1e13524b9ee745456feade656.1744183008.git.anand.jain@oracle.com/
> 
>  check | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/check b/check
> index ede54f6987bc..93d8a6cd3237 100755
> --- a/check
> +++ b/check
> @@ -794,6 +794,7 @@ function run_section()
>  
>  	seq="check.$$"
>  	check="$RESULT_BASE/check"
> +	seqres="$check"
>  
>  	# don't leave old full output behind on a clean run
>  	rm -f $check.full
> @@ -835,7 +836,6 @@ function run_section()
>  	  fi
>  	fi
>  
> -	seqres="$check"
>  	_check_test_fs
>  
>  	loop_status=()	# track rerun-on-failure state
> -- 
> 2.49.0
> 


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

end of thread, other threads:[~2025-07-01 14:28 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-24  3:57 [PATCH 0/2] fstests: cleanup duplicate initialization and avoid writing to .full Anand Jain
2025-05-24  3:57 ` [PATCH 1/2] fstests: remove duplicate initialization in the testcase Anand Jain
2025-07-01 14:15   ` Zorro Lang
2025-05-24  3:57 ` [PATCH 2/2] fstests: check: fix unset seqres in run_section() Anand Jain
2025-07-01 14:28   ` Zorro Lang
2025-07-01 10:02 ` [PATCH 0/2] fstests: cleanup duplicate initialization and avoid writing to .full Anand Jain

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