diff --git a/run-fstests/util/parse_cli b/run-fstests/util/parse_cli index f8912235..3e404985 100644 --- a/run-fstests/util/parse_cli +++ b/run-fstests/util/parse_cli @@ -279,6 +279,7 @@ local-ssd local-ssd-nvme log machtype: +mkfs_config: modules: monitor-timeout: nfssrv: @@ -540,6 +541,9 @@ while (( $# >= 1 )); do KERNEL_ARCH="$1" SKIP_KERNEL_ARCH_PROBE="yes" ;; + --mkfs_config) shift + MKFS_CONFIG="$1" + ;; --modules) shift supported_flavors kvm gce case "$1" in @@ -1132,6 +1136,10 @@ if test -n "$SOAK_DURATION" ; then FSTESTOPT="$FSTESTOPT,soak,$SOAK_DURATION" fi +if test -n "$MKFS_CONFIG" ; then + FSTESTOPT="$FSTESTOPT,mkfs_config,$MKFS_CONFIG" +fi + FSTESTOPT=${FSTESTOPT/#,/} case "$FSTESTCFG" in diff --git a/test-appliance/files/root/fs/xfs/config b/test-appliance/files/root/fs/xfs/config index c0da77c7..e4cdfc31 100644 --- a/test-appliance/files/root/fs/xfs/config +++ b/test-appliance/files/root/fs/xfs/config @@ -3,6 +3,9 @@ # DEFAULT_MKFS_OPTIONS="" +if test -n "$MKFS_CONFIG_FILE" ; then + DEFAULT_MKFS_OPTIONS="-c options=$MKFS_CONFIG_FILE" +fi function check_filesystem() { @@ -26,6 +29,21 @@ function check_filesystem() return "$ret" } +function xfs_adjust_mkfs_opts() +{ + if test -z "$MKFS_CONFIG_FILE" ; then + return + fi + if test -z "$XFS_MKFS_OPTIONS" ; then + XFS_MKFS_OPTIONS="-c options=$MKFS_CONFIG_FILE" + else + XFS_MKFS_OPTIONS="$XFS_MKFS_OPTIONS -c options=$MKFS_CONFIG_FILE" + fi + export XFS_MKFS_OPTIONS +} + +adjust_mkfs_options=xfs_adjust_mkfs_opts + function format_filesystem() { local dev="$1" @@ -85,4 +103,5 @@ function reset_vars() { unset XFS_MOUNT_OPTIONS unset XFS_MKFS_OPTIONS + unset adjust_mkfs_options } diff --git a/test-appliance/files/root/fs/xfs/mkfs_cfg/lts_4.19.conf b/test-appliance/files/root/fs/xfs/mkfs_cfg/lts_4.19.conf new file mode 100644 index 00000000..4f190bac --- /dev/null +++ b/test-appliance/files/root/fs/xfs/mkfs_cfg/lts_4.19.conf @@ -0,0 +1,19 @@ +# V5 features that were the mkfs defaults when the upstream Linux 4.19 LTS +# kernel was released at the end of 2018. + +[metadata] +bigtime=0 +crc=1 +finobt=1 +inobtcount=0 +reflink=0 +rmapbt=0 +autofsck=0 + +[inode] +sparse=1 +nrext64=0 +exchange=0 + +[naming] +parent=0 diff --git a/test-appliance/files/root/fs/xfs/mkfs_cfg/lts_5.10.conf b/test-appliance/files/root/fs/xfs/mkfs_cfg/lts_5.10.conf new file mode 100644 index 00000000..a55fc68e --- /dev/null +++ b/test-appliance/files/root/fs/xfs/mkfs_cfg/lts_5.10.conf @@ -0,0 +1,19 @@ +# V5 features that were the mkfs defaults when the upstream Linux 5.10 LTS +# kernel was released at the end of 2020. + +[metadata] +bigtime=0 +crc=1 +finobt=1 +inobtcount=0 +reflink=1 +rmapbt=0 +autofsck=0 + +[inode] +sparse=1 +nrext64=0 +exchange=0 + +[naming] +parent=0 diff --git a/test-appliance/files/root/fs/xfs/mkfs_cfg/lts_5.15.conf b/test-appliance/files/root/fs/xfs/mkfs_cfg/lts_5.15.conf new file mode 100644 index 00000000..daea0b40 --- /dev/null +++ b/test-appliance/files/root/fs/xfs/mkfs_cfg/lts_5.15.conf @@ -0,0 +1,19 @@ +# V5 features that were the mkfs defaults when the upstream Linux 5.15 LTS +# kernel was released at the end of 2021. + +[metadata] +bigtime=1 +crc=1 +finobt=1 +inobtcount=1 +reflink=1 +rmapbt=0 +autofsck=0 + +[inode] +sparse=1 +nrext64=0 +exchange=0 + +[naming] +parent=0 diff --git a/test-appliance/files/root/fs/xfs/mkfs_cfg/lts_5.4.conf b/test-appliance/files/root/fs/xfs/mkfs_cfg/lts_5.4.conf new file mode 100644 index 00000000..0f807fc3 --- /dev/null +++ b/test-appliance/files/root/fs/xfs/mkfs_cfg/lts_5.4.conf @@ -0,0 +1,19 @@ +# V5 features that were the mkfs defaults when the upstream Linux 5.4 LTS +# kernel was released at the end of 2019. + +[metadata] +bigtime=0 +crc=1 +finobt=1 +inobtcount=0 +reflink=1 +rmapbt=0 +autofsck=0 + +[inode] +sparse=1 +nrext64=0 +exchange=0 + +[naming] +parent=0 diff --git a/test-appliance/files/root/fs/xfs/mkfs_cfg/lts_6.1.conf b/test-appliance/files/root/fs/xfs/mkfs_cfg/lts_6.1.conf new file mode 100644 index 00000000..0ff5bbad --- /dev/null +++ b/test-appliance/files/root/fs/xfs/mkfs_cfg/lts_6.1.conf @@ -0,0 +1,19 @@ +# V5 features that were the mkfs defaults when the upstream Linux 6.1 LTS +# kernel was released at the end of 2022. + +[metadata] +bigtime=1 +crc=1 +finobt=1 +inobtcount=1 +reflink=1 +rmapbt=0 +autofsck=0 + +[inode] +sparse=1 +nrext64=0 +exchange=0 + +[naming] +parent=0 diff --git a/test-appliance/files/root/fs/xfs/mkfs_cfg/lts_6.12.conf b/test-appliance/files/root/fs/xfs/mkfs_cfg/lts_6.12.conf new file mode 100644 index 00000000..35b79082 --- /dev/null +++ b/test-appliance/files/root/fs/xfs/mkfs_cfg/lts_6.12.conf @@ -0,0 +1,19 @@ +# V5 features that were the mkfs defaults when the upstream Linux 6.12 LTS +# kernel was released at the end of 2024. + +[metadata] +bigtime=1 +crc=1 +finobt=1 +inobtcount=1 +reflink=1 +rmapbt=1 +autofsck=0 + +[inode] +sparse=1 +nrext64=1 +exchange=0 + +[naming] +parent=0 diff --git a/test-appliance/files/root/fs/xfs/mkfs_cfg/lts_6.6.conf b/test-appliance/files/root/fs/xfs/mkfs_cfg/lts_6.6.conf new file mode 100644 index 00000000..2ef5957e --- /dev/null +++ b/test-appliance/files/root/fs/xfs/mkfs_cfg/lts_6.6.conf @@ -0,0 +1,19 @@ +# V5 features that were the mkfs defaults when the upstream Linux 6.6 LTS +# kernel was released at the end of 2023. + +[metadata] +bigtime=1 +crc=1 +finobt=1 +inobtcount=1 +reflink=1 +rmapbt=1 +autofsck=0 + +[inode] +sparse=1 +nrext64=1 +exchange=0 + +[naming] +parent=0 diff --git a/test-appliance/files/root/runtests.sh b/test-appliance/files/root/runtests.sh index 714ff14e..ce2ca5da 100755 --- a/test-appliance/files/root/runtests.sh +++ b/test-appliance/files/root/runtests.sh @@ -62,6 +62,9 @@ while [ "$1" != "" ]; do no_truncate_test_files) NO_TRUNCATE=t ;; + mkfs_config) shift + MKFS_CONFIG="$1" + ;; *) echo " " echo "Unrecognized option $1" @@ -71,6 +74,9 @@ while [ "$1" != "" ]; do done gen_version_files +if test -z "$MKFS_CONFIG" ; then + set_mkfs_config +fi umount "$PRI_TST_DEV" >& /dev/null umount "$SM_TST_DEV" >& /dev/null if ! get_fs_config $FSTESTTYP ; then @@ -294,6 +300,9 @@ do echo TEST_LOGDEV: $TEST_LOGDEV >> "$RESULT_BASE/config" echo SCRATCH_RTDEV: $SCRATCH_RTDEV >> "$RESULT_BASE/config" echo TEST_RTDEV: $TEST_RTDEV >> "$RESULT_BASE/config" + if test -n "$MKFS_CONFIG_FILE" ; then + echo MKFS_CONFIG: $MKFS_CONFIG >> "$RESULT_BASE/config" + fi show_mkfs_opts >> "$RESULT_BASE/config" show_mount_opts >> "$RESULT_BASE/config" if test -n "$SCRATCH_DEV_POOL" ; then diff --git a/test-appliance/files/root/runtests_utils b/test-appliance/files/root/runtests_utils index ecfdc7dc..df9e3fd7 100644 --- a/test-appliance/files/root/runtests_utils +++ b/test-appliance/files/root/runtests_utils @@ -17,6 +17,13 @@ function get_fs_config() fi . "$FS_DIR/config" FS_CONFIGURED="$fs" + MKFS_CONFIG_FILE= + if test -n "$MKFS_CONFIG" ; then + MKFS_CONFIG_FILE="$FS_DIR/mkfs_cfg/$MKFS_CONFIG.conf" + if ! test -f "$MKFS_CONFIG_FILE" ; then + MKFS_CONFIG_FILE= + fi + fi return 0 } @@ -101,6 +108,9 @@ function get_one_fs_config() { echo "Unknown configuration $FS/$TC" return 1 fi + if test -n "$adjust_mkfs_options" ; then + $adjust_mkfs_options + fi if test -z "$TEST_DEV" ; then if test -z "$SIZE" ; then echo "No TEST_DEV and no SIZE" @@ -279,6 +289,47 @@ function gen_version_files () test -n "$TC" && echo TEST_CFG=$TC >> $vi_sh } +function set_mkfs_config +{ + . /run/version_info.sh + case "$LINUX_VERSION_MAJOR" in + 4) + case "$LINUX_VERSION_MINOR" in + 19) + MKFS_CONFIG=lts_4.19 + ;; + esac + ;; + 5) + case "$LINUX_VERSION_MINOR" in + 4) + MKFS_CONFIG=lts_5.4 + ;; + 10) + MKFS_CONFIG=lts_5.10 + ;; + 14|15) + # 5.14 is an honorary 5.15 for RHEL 9 and SLES 15 SP4+ + MKFS_CONFIG=lts_5.15 + ;; + esac + ;; + 6) + case "$LINUX_VERSION_MINOR" in + 1) + MKFS_CONFIG=lts_6.1 + ;; + 6) + MKFS_CONFIG=lts_6.6 + ;; + 12) + MKFS_CONFIG=lts_6.12 + ;; + esac + ;; + esac +} + function clear_pool_devs () { if test -n "$POOL0_DEV" ; then