fstests: cleanup duplicate initialization and avoid writing to .full
cover fstests: cleanup duplicate initialization and avoid writing to .full
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.
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(-)
Signature · 1 line
2.49.0
PATCH 1/2 fstests: remove duplicate initialization in the testcase
_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.
--- tests/btrfs/253 | 3 --- tests/ext4/053 | 10 ---------- 2 files changed, 13 deletions(-)
tests/btrfs/253 +0 -3
@@ -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:
tests/ext4/053 +0 -10
@@ -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
Signature · 1 line
2.49.0
Re: [PATCH 1/2] fstests: remove duplicate initialization in the testcase
Quoted 10 lines · Anand Jain
_begin_fstest()already initializes several variables, includingseqandseqres, so remove those redundant initializations from the testcase.Also, ext4/053 unnecessarily re-initializes
here,tmp, andstatus, which_begin_fstestalready handles. Remove those as well.and remove template comment.
Signed-off-by Anand Jain <[email protected]>---
Thanks for cleaning up these redundant codes,
Quoted 52 lines
tests/btrfs/253 | 3 --- tests/ext4/053 | 10 ---------- 2 files changed, 13 deletions(-)tests/btrfs/253 +0
-3@@ -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:tests/ext4/053 +0
-10@@ -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 KBSignature · 1 line
2.49.0
PATCH 2/2 fstests: check: fix unset seqres in run_section()
In reply to Anand JainWhile 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.
---
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(-)
check +1 -1
@@ -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
Signature · 1 line
2.49.0
Re: [PATCH 2/2] fstests: check: fix unset seqres in run_section()
Quoted 8 lines · Anand Jain
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_unmount2>/dev/null
817 # call the overridden mkfs - make sure the FS is built
Quoted 4 lines
Ensure seqres is set early in
run_section()as a fix.Signed-off-by Anand Jain <[email protected]>---
Quoted 30 lines
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(-)check +1
-1@@ -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 stateSignature · 1 line
2.49.0
Zorro, just a gentle ping on this patchset.
Thanks.
Quoted 17 lines · Anand Jain
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.Anand Jain (2):
fstests: remove duplicate initialization in the testcase
fstests: check: fix unset seqres inrun_section()check | 2 +- tests/btrfs/253 | 3 --- tests/ext4/053 | 10 ---------- 3 files changed, 1 insertion(+), 14 deletions(-)