common/config: unset TEST_FS_MOUNT_OPTS across config sections
PATCH 1/2 common/config: unset TEST_FS_MOUNT_OPTS across config sections
TEST_FS_MOUNT_OPTS doesn't get reset before parsing next config section, this will cause unexpected TEST_FS_MOUNT_OPTS in test, because it can be assigned some fs-specific mount options in _test_mount_opts, which might not be supported by the filesystem in next config section. And MOUNT_OPTIONS is reset, I don't see why TEST_FS_MOUNT_OPTS shouldn't be.
Also update README.config-sections to reflect this change and fix typos (replace MOUNT_OPTIONS with TEST_FS_MOUNT_OPTS).
--- README.config-sections | 10 +++++----- common/config | 1 + 2 files changed, 6 insertions(+), 5 deletions(-)
README.config-sections +5 -5
@@ -40,8 +40,8 @@ Different mount options ----------------------- Specifying different mount options in difference config sections is allowed. -When MOUNT_OPTIONS differs in the following section TEST_DEV will be remounted -with new MOUNT_OPTIONS automatically before running the test. +When TEST_FS_MOUNT_OPTS differs in the following section TEST_DEV will be +remounted with new TEST_FS_MOUNT_OPTS automatically before running the test. Multiple file systems
@@ -51,9 +51,9 @@ Having different file systems in different config sections is allowed. When FSTYP differs in the following section the FSTYP file system will be created automatically before running the test. -Note that if MOUNT_OPTIONS, MKFS_OPTIONS, or FSCK_OPTIONS are not directly -specified in the section it will be reset to the default for a given file -system. +Note that if TEST_FS_MOUNT_OPTS, MOUNT_OPTIONS, MKFS_OPTIONS, or FSCK_OPTIONS +are not directly specified in the section it will be reset to the default for a +given file system. You can also force the file system recreation by specifying RECREATE_TEST_DEV.
common/config +1 -0
@@ -602,6 +602,7 @@ get_next_config() { local OLD_USE_EXTERNAL=$USE_EXTERNAL unset MOUNT_OPTIONS + unset TEST_FS_MOUNT_OPTS unset MKFS_OPTIONS unset FSCK_OPTIONS unset USE_EXTERNAL
Signature · 1 line
2.13.3
PATCH 2/2 check: source common/rc again if TEST_DEV was recreated
If TEST_DEV is recreated by check, FSTYP derived from TEST_DEV previously could be changed too and might not reflect the reality. So source common/rc again with correct FSTYP to get fs-specific configs, e.g. common/xfs.
For example, using this config-section config file, and run section ext4 first then xfs, you can see:
our local _scratch_mkfs routine ...
./common/rc: line 825: _scratch_mkfs_xfs: command not found
check: failed to mkfs $SCRATCH_DEV using specified options
local.config:
[default]
RECREATE_TEST_DEV=true
TEST_DEV=/dev/sda5
SCRATCH_DEV=/dev/sda6
TEST_DIR=/mnt/test
SCRATCH_MNT=/mnt/scratch
[ext4]
MKFS_OPTIONS="-b 4096"
FSTYP=ext4
[xfs]
FSTYP=xfs
MKFS_OPTIONS="-f -b size=4k"
--- check | 4 ++++ 1 file changed, 4 insertions(+)
check +4 -0
@@ -555,6 +555,10 @@ for section in $HOST_OPTIONS_SECTIONS; do status=1 exit fi + # TEST_DEV has been recreated, previous FSTYP derived from + # TEST_DEV could be changed, source common/rc again with + # correct FSTYP to get FSTYP specific configs, e.g. common/xfs + . common/rc _prepare_test_list elif [ "$OLD_TEST_FS_MOUNT_OPTS" != "$TEST_FS_MOUNT_OPTS" ]; then _test_unmount 2> /dev/null
Signature · 1 line
2.13.3
Quoted 49 lines · Eryu Guan
TEST_FS_MOUNT_OPTSdoesn't get reset before parsing next config section, this will cause unexpectedTEST_FS_MOUNT_OPTSin test, because it can be assigned some fs-specific mount options in_test_mount_opts, which might not be supported by the filesystem in next config section. AndMOUNT_OPTIONSis reset, I don't see whyTEST_FS_MOUNT_OPTSshouldn't be.Also update README.config-sections to reflect this change and fix typos (replace
MOUNT_OPTIONSwithTEST_FS_MOUNT_OPTS).Signed-off-by Eryu Guan <[email protected]>--- README.config-sections | 10 +++++----- common/config | 1 + 2 files changed, 6 insertions(+), 5 deletions(-)README.config-sections +5
-5@@ -40,8 +40,8 @@ Different mount options ----------------------- Specifying different mount options in difference config sections is allowed. -When MOUNT_OPTIONS differs in the following section TEST_DEV will be remounted -with new MOUNT_OPTIONS automatically before running the test. +When TEST_FS_MOUNT_OPTS differs in the following section TEST_DEV will be +remounted with new TEST_FS_MOUNT_OPTS automatically before running the test. Multiple file systems@@ -51,9 +51,9 @@ Having different file systems in different config sections is allowed. When FSTYP differs in the following section the FSTYP file system will be created automatically before running the test. -Note that if MOUNT_OPTIONS, MKFS_OPTIONS, or FSCK_OPTIONS are not directly -specified in the section it will be reset to the default for a given file -system. +Note that if TEST_FS_MOUNT_OPTS, MOUNT_OPTIONS, MKFS_OPTIONS, or FSCK_OPTIONS +are not directly specified in the section it will be reset to the default for a +given file system. You can also force the file system recreation by specifying RECREATE_TEST_DEV.common/config +0
-0
common/config get_next_config() { · line 608
Quoted 7 lines
common/config +1
-0@@ -602,6 +602,7 @@ get_next_config() { local OLD_USE_EXTERNAL=$USE_EXTERNAL unset MOUNT_OPTIONS + unset TEST_FS_MOUNT_OPTS unset MKFS_OPTIONS unset FSCK_OPTIONS unset USE_EXTERNAL
Hi Eryu,
It looks fine to me.
Thanks,
Xiao Yang
Re: [PATCH 2/2] check: source common/rc again if TEST_DEV was recreated
In reply to Eryu GuanQuoted 38 lines · Eryu Guan
If
TEST_DEVis recreated by check, FSTYP derived fromTEST_DEVpreviously could be changed too and might not reflect the reality. So source common/rc again with correct FSTYP to get fs-specific configs, e.g. common/xfs.For example, using this config-section config file, and run section ext4 first then xfs, you can see:
our local
_scratch_mkfsroutine ...
./common/rc: line 825:_scratch_mkfs_xfs: command not found
check: failed to mkfs $SCRATCH_DEV using specified optionslocal.config:
[default]
RECREATE_TEST_DEV=true
TEST_DEV=/dev/sda5
SCRATCH_DEV=/dev/sda6
TEST_DIR=/mnt/test
SCRATCH_MNT=/mnt/scratch[ext4]
MKFS_OPTIONS="-b 4096"
FSTYP=ext4[xfs]
FSTYP=xfs
MKFS_OPTIONS="-f -b size=4k"Signed-off-by Eryu Guan <[email protected]>--- check | 4 ++++ 1 file changed, 4 insertions(+)check +0
-0
check for section in $HOST_OPTIONS_SECTIONS; do · line 564
Quoted 10 lines
check +4
-0@@ -555,6 +555,10 @@ for section in $HOST_OPTIONS_SECTIONS; do status=1 exit fi + # TEST_DEV has been recreated, previous FSTYP derived from + # TEST_DEV could be changed, source common/rc again with + # correct FSTYP to get FSTYP specific configs, e.g. common/xfs + . common/rc _prepare_test_list elif [ "$OLD_TEST_FS_MOUNT_OPTS" != "$TEST_FS_MOUNT_OPTS" ]; then _test_unmount 2> /dev/null
Hi Eryu,
Could we replace init_rc with common/rc to get correct FSTYP and call init_rc?
Like this:
--------------------------------------------------------------------------------
check +0 -0
@@ -566,7 +566,7 @@ for section in $HOST_OPTIONS_SECTIONS; do
fi
fi
- init_rc
+ . common/rc
---------------------------------------------------------------------------------
Thanks,
Xiao Yang.
Re: [PATCH 2/2] check: source common/rc again if TEST_DEV was recreated
Quoted 51 lines · Xiao Yang
Quoted 38 lines · Eryu Guan
If
TEST_DEVis recreated by check, FSTYP derived fromTEST_DEVpreviously could be changed too and might not reflect the reality. So source common/rc again with correct FSTYP to get fs-specific configs, e.g. common/xfs.For example, using this config-section config file, and run section ext4 first then xfs, you can see:
our local
_scratch_mkfsroutine ...
./common/rc: line 825:_scratch_mkfs_xfs: command not found
check: failed to mkfs $SCRATCH_DEV using specified optionslocal.config:
[default]
RECREATE_TEST_DEV=true
TEST_DEV=/dev/sda5
SCRATCH_DEV=/dev/sda6
TEST_DIR=/mnt/test
SCRATCH_MNT=/mnt/scratch[ext4]
MKFS_OPTIONS="-b 4096"
FSTYP=ext4[xfs]
FSTYP=xfs
MKFS_OPTIONS="-f -b size=4k"Signed-off-by Eryu Guan <[email protected]>--- check | 4 ++++ 1 file changed, 4 insertions(+)check +0
-0check for section in $HOST_OPTIONS_SECTIONS; do · line 564
Quoted 10 lines
check +4
-0@@ -555,6 +555,10 @@ for section in $HOST_OPTIONS_SECTIONS; do status=1 exit fi + # TEST_DEV has been recreated, previous FSTYP derived from + # TEST_DEV could be changed, source common/rc again with + # correct FSTYP to get FSTYP specific configs, e.g. common/xfs + . common/rc _prepare_test_list elif [ "$OLD_TEST_FS_MOUNT_OPTS" != "$TEST_FS_MOUNT_OPTS" ]; then _test_unmount 2> /dev/nullHi Eryu,
Quoted 2 lines
Could we replace
init_rcwith common/rc to get correct FSTYP and callinit_rc?
Yeah, that should work too, but sourcing common/rc explicitly only when needed looks clearer to me.
Thanks for the review!
Eryu
Quoted 21 lines
Like this:
--------------------------------------------------------------------------------
check +0
-0@@ -566,7 +566,7 @@ for section in $HOST_OPTIONS_SECTIONS; dofi
fi-
init_rc
+ . common/rc
---------------------------------------------------------------------------------Thanks,
Xiao Yang.--
To unsubscribe from this list: send the line "unsubscribe fstests" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH RESEND 1/1 check: source common/rc again if TEST_DEV was recreated
In reply to Eryu GuanIf TEST_DEV is recreated by check, FSTYP derived from TEST_DEV previously could be changed too and might not reflect the reality. So source common/rc again with correct FSTYP to get fs-specific configs, e.g. common/xfs.
For example, using this config-section config file, and run section ext4 first then xfs, you can see:
our local _scratch_mkfs routine ...
./common/rc: line 825: _scratch_mkfs_xfs: command not found
check: failed to mkfs $SCRATCH_DEV using specified options
local.config:
[default]
RECREATE_TEST_DEV=true
TEST_DEV=/dev/sda5
SCRATCH_DEV=/dev/sda6
TEST_DIR=/mnt/test
SCRATCH_MNT=/mnt/scratch
[ext4]
MKFS_OPTIONS="-b 4096"
FSTYP=ext4
[xfs]
FSTYP=xfs
MKFS_OPTIONS="-f -b size=4k"
--- check | 4 ++++ 1 file changed, 4 insertions(+)
check +4 -0
@@ -555,6 +555,10 @@ for section in $HOST_OPTIONS_SECTIONS; do status=1 exit fi + # TEST_DEV has been recreated, previous FSTYP derived from + # TEST_DEV could be changed, source common/rc again with + # correct FSTYP to get FSTYP specific configs, e.g. common/xfs + . common/rc _prepare_test_list elif [ "$OLD_TEST_FS_MOUNT_OPTS" != "$TEST_FS_MOUNT_OPTS" ]; then _test_unmount 2> /dev/null
Signature · 1 line
2.13.3