[缺陷描述]: 使用gitee anck-5.10分支xfstests代码,对ext4 overlay文件系统做测试,会报错mount: /fs/sdb2: can't find in /etc/fstab 报错日志如下: test disk info: FSTYP is: ext4 TEST_DEV is: /dev/sdb1 SCRATCH_DEV is: /dev/sdb2 TEST_DIR is: /fs/sdb1 SCRATCH_MNT is: /fs/sdb2 options is -overlay -E blacklists/exclude mount: /fs/sdb1: can't find in /etc/fstab. test is auto FSTYP -- overlay PLATFORM -- Linux/x86_64 e69b01521 5.10.134-644.git.df0033244.an8.x86_64 #1 SMP Tue Apr 25 13:48:23 UTC 2023 MKFS_OPTIONS -- /fs/sdb2 MOUNT_OPTIONS -- /fs/sdb2 /fs/sdb2/ovl-mnt umount: /fs/sdb2: not mounted. mount: /fs/sdb1: can't find in /etc/fstab. umount: /fs/sdb1: not mounted. generic/001 3s mount: /fs/sdb1: can't find in /etc/fstab. generic/002 0s umount: /fs/sdb1: not mounted. mount: /fs/sdb1: can't find in /etc/fstab. generic/003 - output mismatch (see /tmp/tone/run/xfstests/results//generic/003.out.bad) umount: /fs/sdb1: not mounted. mount: /fs/sdb2: can't find in /etc/fstab. --- tests/generic/003.out 2023-04-25 23:24:09.394002665 +0800 +++ /tmp/tone/run/xfstests/results//generic/003.out.bad 2023-04-25 23:25:44.238111976 +0800 @@ -1,2 +1,14 @@ QA output created by 003 +mount: /fs/sdb2: can't find in /etc/fstab. +umount: /fs/sdb2: not mounted. +mount: /fs/sdb2: can't find in /etc/fstab. +umount: /fs/sdb2: not mounted. +mount: /fs/sdb2: can't find in /etc/fstab. +umount: /fs/sdb2: not mounted. ... (Run 'diff -u /tmp/tone/run/xfstests/tests/generic/003.out /tmp/tone/run/xfstests/results//generic/003.out.bad' to see the entire diff) generic/004 [not run] O_TMPFILE is not supported generic/005 0s umount: /fs/sdb2: not mounted. mount: /fs/sdb1: can't find in /etc/fstab. generic/006 1s umount: /fs/sdb1: not mounted. mount: /fs/sdb1: can't find in /etc/fstab. generic/007 0s umount: /fs/sdb1: not mounted. mount: /fs/sdb1: can't find in /etc/fstab. generic/008 1s umount: /fs/sdb1: not mounted. mount: /fs/sdb1: can't find in /etc/fstab. generic/009 1s umount: /fs/sdb1: not mounted. mount: /fs/sdb1: can't find in /etc/fstab. generic/010 [not run] /tmp/tone/run/xfstests/src/dbtest not built generic/011 0s umount: /fs/sdb1: not mounted. mount: /fs/sdb1: can't find in /etc/fstab. generic/012 - output mismatch (see /tmp/tone/run/xfstests/results//generic/012.out.bad) umount: /fs/sdb1: not mounted. mount: /fs/sdb1: can't find in /etc/fstab. --- tests/generic/012.out 2023-04-25 23:24:09.382002274 +0800 +++ /tmp/tone/run/xfstests/results//generic/012.out.bad 2023-04-25 23:25:48.409248481 +0800 @@ -47,3 +47,5 @@ 14. data -> hole @ 0 0: [0..383]: extent cc767c0ddc3ff5704c2de7f801707d85 +mount: /fs/sdb1: can't find in /etc/fstab. +umount: /fs/sdb1: not mounted. ... (Run 'diff -u /tmp/tone/run/xfstests/tests/generic/012.out /tmp/tone/run/xfstests/results//generic/012.out.bad' to see the entire diff) generic/013 - output mismatch (see /tmp/tone/run/xfstests/results//generic/013.out.bad) umount: /fs/sdb1: not mounted. mount: /fs/sdb1: can't find in /etc/fstab. --- tests/generic/013.out 2023-04-25 23:24:09.096992980 +0800 +++ /tmp/tone/run/xfstests/results//generic/013.out.bad 2023-04-25 23:25:50.619320807 +0800 @@ -1,14 +1,24 @@ [复现概率]: 必现 [复现环境]: 内核: # uname -r 5.10.134-644.git.df0033244.an8.x86_64 # cat /etc/os-release NAME="Anolis OS" VERSION="8.8" ID="anolis" ID_LIKE="rhel fedora centos" VERSION_ID="8.8" PLATFORM_ID="platform:an8" PRETTY_NAME="Anolis OS 8.8" ANSI_COLOR="0;31" HOME_URL="https://openanolis.cn/" CPU信息: # lscpu Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian CPU(s): 24 On-line CPU(s) list: 0-23 Thread(s) per core: 2 Core(s) per socket: 12 Socket(s): 1 NUMA node(s): 1 Vendor ID: GenuineIntel BIOS Vendor ID: Intel CPU family: 6 Model: 63 Model name: Intel(R) Xeon(R) CPU E5-2680 v3 @ 2.50GHz BIOS Model name: Intel(R) Xeon(R) CPU E5-2680 v3 @ 2.50GHz Stepping: 2 CPU MHz: 2494.439 CPU max MHz: 2500.0000 CPU min MHz: 1200.0000 BogoMIPS: 4988.84 Virtualization: VT-x L1d cache: 32K L1i cache: 32K L2 cache: 256K L3 cache: 30720K NUMA node0 CPU(s): 0-23 Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm cpuid_fault epb invpcid_single pti intel_ppin ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid cqm xsaveopt cqm_llc cqm_occup_llc dtherm arat pln pts md_clear flush_l1 内存信息: # free -h total used free shared buff/cache available Mem: 62Gi 1.2Gi 59Gi 9.0Mi 1.3Gi 60Gi Swap: 2.0Gi 0B 2.0Gi 磁盘信息: # lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 223.6G 0 disk ├─sda1 8:1 0 4M 0 part ├─sda2 8:2 0 1G 0 part /boot ├─sda3 8:3 0 50G 0 part / ├─sda4 8:4 0 2G 0 part [SWAP] └─sda5 8:5 0 170.6G 0 part sdb 8:16 0 1.8T 0 disk ├─sdb1 8:17 0 850.9G 0 part └─sdb2 8:18 0 852.8G 0 part sdc 8:32 0 959.7M 0 disk sdd 8:48 0 1.8T 0 disk ├─sdd1 8:49 0 850.9G 0 part └─sdd2 8:50 0 852.8G 0 part sde 8:64 0 1.8T 0 disk sdf 8:80 0 1.8T 0 disk sdg 8:96 0 1.8T 0 disk sdh 8:112 0 1.8T 0 disk sdi 8:128 0 1.8T 0 disk sdj 8:144 0 1.8T 0 disk sdk 8:160 0 1.8T 0 disk sdl 8:176 0 1.8T 0 disk [复现步骤]: git clone https://gitee.com/anolis/xfstests.git -b anck-5.10 cd xfstests export CFLAGS="-fcommon" make configure ./configure make && make install export FSTYP=overlay export TEST_DEV=/dev/sdb1 export SCRATCH_DEV=/dev/sdb2 export TEST_DIR=/fs/sdb1 export SCRATCH_MNT=/fs/sdb2 ./check generic/037 [预期结果]: 用例执行成功 [实际结果]: 用例执行失败 [原因分析] 感觉是测试用例问题,取xfstests最新的测试代码,是可以正常测试的,不会有这种报错,mount: /fs/sdb2: can't find in /etc/fstab
这个是使用github最新代码的测试结果,相同环境,用例是可以pass的 git clone https://github.com/kdave/xfstests.git # ./check generic/037 FSTYP -- overlay PLATFORM -- Linux/x86_64 e69b01521 5.10.134-644.git.df0033244.an8.x86_64 #1 SMP Tue Apr 25 13:48:23 UTC 2023 MKFS_OPTIONS -- /fs/sdb2 MOUNT_OPTIONS -- /fs/sdb2 /fs/sdb2/ovl-mnt generic/037 3s ... 3s Ran: generic/037 Passed all 1 tests
再补充一个generic/001使用github最新xfstests代码的测试结果 # ./check generic/001 FSTYP -- overlay PLATFORM -- Linux/x86_64 e69b01521 5.10.134-644.git.df0033244.an8.x86_64 #1 SMP Tue Apr 25 13:48:23 UTC 2023 MKFS_OPTIONS -- /fs/sdb2 MOUNT_OPTIONS -- /fs/sdb2 /fs/sdb2/ovl-mnt generic/001 3s Ran: generic/001
把调试开关打开,发现在使用gitee代码做ext4 overlay测试时,挂载命令有问题,/usr/bin/mount -t /dev/sdb1 /fs/sdb1 相关日志: + _mount -t /dev/sdb1 /fs/sdb1 ++ _mount_ops_filter -t /dev/sdb1 /fs/sdb1 ++ local 'params=-t /dev/sdb1 /fs/sdb1' ++ local last_index=2 ++ '[' 2 -gt 0 ']' ++ shift 2 ++ local fs_escaped=/fs/sdb1 ++ echo -t /dev/sdb1 /fs/sdb1 ++ /usr/bin/perl -ne 's#mtpt=[^,|^\n|^\s]*#mtpt=/fs/sdb1\1\2#; print;' + /usr/bin/mount -t /dev/sdb1 /fs/sdb1 mount: /fs/sdb1: can't find in /etc/fstab. 相比执行,使用github最新代码测试,挂载命令是正确的,/usr/bin/mount /dev/sdb1 /fs/sdb1 相关日志: 721 ++ _mount /dev/sdb1 /fs/sdb1 722 ++ /usr/bin/mount /dev/sdb1 /fs/sdb1 723 ++ _idmapped_mount /dev/sdb1 /fs/sdb1 724 ++ '[' '' = true ']' 725 ++ return 0 726 ++ _overlay_mount /fs/sdb1 /fs/sdb1/ovl-mnt 727 ++ local dir=/fs/sdb1 728 ++ local mnt=/fs/sdb1/ovl-mnt 729 ++ shift 2 730 ++ _supports_filetype /fs/sdb1 731 ++ local dir=/fs/sdb1 732 +++ /usr/bin/df -T -P /fs/sdb1 733 +++ tail -1 734 +++ /usr/bin/awk '{print $2}'
upstream最新的代码已经修复了该问题,本地验证ok,已经同步相关patch,并提交评审 https://github.com/kdave/xfstests/commit/e3774b281662d04a3cdab6c2eda2742a61854176
已经提交代码修复,并合入,关闭该bug