[缺陷描述]: xfstests:ext4-nfsv3-2 nfs文件系统,generic/193测试用例执行失败,test out the clear of suid/sgid for truncate不符合预期; 失败日志如下: #./check -nfs generic/193 FSTYP -- nfs PLATFORM -- Linux/aarch64 VM20200706-20 5.10.134-947.git.9eb9e601b.al8.aarch64 #1 SMP Tue May 30 13:56:15 UTC 2023 MKFS_OPTIONS -- localhost:/export//fs/vdb2 MOUNT_OPTIONS -- -o vers=3 localhost:/export//fs/vdb2 /nfs/vdb2 generic/193 - output mismatch (see /tmp/tone/run/xfstests/results//generic/193.out.bad) --- tests/generic/193.out 2023-05-31 01:04:46.584151545 +0800 +++ /tmp/tone/run/xfstests/results//generic/193.out.bad 2023-05-31 14:21:20.693181217 +0800 @@ -32,10 +32,10 @@ check that suid/sgid bits are cleared after successful chown... with no exec perm before: -rwSr-Sr-- -after: -rw-r-Sr-- +after: -rw-r--r-- with user exec perm before: -rwsr-Sr-- ... (Run 'diff -u /tmp/tone/run/xfstests/tests/generic/193.out /tmp/tone/run/xfstests/results//generic/193.out.bad' to see the entire diff) Ran: generic/193 Failures: generic/193 Failed 1 of 1 tests # diff -u /tmp/tone/run/xfstests/tests/generic/193.out /tmp/tone/run/xfstests/results//generic/193.out.bad --- /tmp/tone/run/xfstests/tests/generic/193.out 2023-05-31 01:04:46.584151545 +0800 +++ /tmp/tone/run/xfstests/results//generic/193.out.bad 2023-05-31 14:21:20.693181217 +0800 @@ -32,10 +32,10 @@ check that suid/sgid bits are cleared after successful chown... with no exec perm before: -rwSr-Sr-- -after: -rw-r-Sr-- +after: -rw-r--r-- with user exec perm before: -rwsr-Sr-- -after: -rwxr-Sr-- +after: -rwxr--r-- with group exec perm before: -rwSr-sr-- after: -rw-r-xr-- [复现概率]: 必现 [复现环境]: 内核: # uname -r 5.10.134-945.git.9eb9e601b492.al8.x86_64 # ]# cat /etc/os-release NAME="Alibaba Cloud Linux" VERSION="3 (Soaring Falcon)" ID="alinux" ID_LIKE="rhel fedora centos" VERSION_ID="3" PLATFORM_ID="platform:al8" PRETTY_NAME="Alibaba Cloud Linux 3 (Soaring Falcon)" ANSI_COLOR="0;31" HOME_URL="https://www.aliyun.com/" CPU信息: # lscpu Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian CPU(s): 8 On-line CPU(s) list: 0-7 Thread(s) per core: 2 Core(s) per socket: 4 Socket(s): 1 NUMA node(s): 1 Vendor ID: GenuineIntel BIOS Vendor ID: Alibaba Cloud CPU family: 6 Model: 85 Model name: Intel(R) Xeon(R) Platinum 8269CY CPU @ 2.50GHz BIOS Model name: pc-i440fx-2.1 Stepping: 7 CPU MHz: 2500.016 BogoMIPS: 5000.03 Hypervisor vendor: KVM Virtualization type: full L1d cache: 32K L1i cache: 32K L2 cache: 1024K L3 cache: 36608K NUMA node0 CPU(s): 0-7 Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl cpuid tsc_known_freq pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single pti ibrs ibpb stibp fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx avx512f avx512dq rdseed adx smap avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 内存信息: # free -h total used free shared buff/cache available Mem: 31Gi 893Mi 29Gi 2.0Mi 751Mi 29Gi Swap: 0B 0B 0B [复现步骤]: 1.下载并编译测试套 git clone --branch kernel-5.10 https://code.alibaba-inc.com/AKTF/xfstests-dev.git cd xfstests export CFLAGS="-fcommon" make configure ./configure make && make install 2.初始化测试盘 dmsetup remove_all wipefs -a --force /dev/vdb1 wipefs -a --force /dev/vdb2 mkfs -t ext4 -q -F /dev/vdb1 mkfs -t ext4 -q -F /dev/vdb2 mkdir -p /fs/vdb1 mount -t ext4 /dev/vdb1 /fs/vdb1 mkdir -p /fs/vdb2 mount -t ext4 /dev/vdb2 /fs/vdb2 yum install -y nfs-utils nfs4-acl-tools mkdir -p /export mount -t tmpfs nfsv4_root_export /export mkdir -p /export//fs/vdb1 mount --bind /fs/vdb1 /export//fs/vdb1 echo '/export *(fsid=0,rw,no_subtree_check,no_root_squash)' > /etc/exports echo '/export//fs/vdb1 *(rw,no_subtree_check,no_root_squash)' >> /etc/exports mkdir -p /export//fs/vdb2 mount --bind /fs/vdb2 /export//fs/vdb2 echo '/export//fs/vdb2 *(rw,no_subtree_check,no_root_squash)' >> /etc/exports systemctl restart rpcbind systemctl restart nfs-server exportfs -r mkdir -p /nfs/vdb1 mount -t nfs -o vers=3 localhost:/export//fs/vdb1 /nfs/vdb1 mkdir -p /nfs/vdb2 mount -t nfs -o vers=3 localhost:/export//fs/vdb2 /nfs/vdb2 umount -f -l /nfs/vdb1 /nfs/vdb2 /fs/vdb1 /fs/vdb2 export TEST_DIR=/nfs/vdb1 export TEST_DEV=/dev/vdb1 export FSTYP=nfs export nfsvers=3 export SCRATCH_MNT=/fs/scratch mkdir /nfs/vdb1 -p mkdir /fs/scratch -p export SCRATCH_DEV=/dev/vdb2 export TEST_DIR=/nfs/vdb1 export SCRATCH_MNT=/nfs/vdb2 export TEST_DEV=localhost:/export//fs/vdb1 export SCRATCH_DEV=localhost:/export//fs/vdb2 export 'TEST_FS_MOUNT_OPTS=-o vers=3' export 'MOUNT_OPTIONS=-o vers=3' 3.执行测试用例 ./check -nfs generic/193 [预期结果]: 用例执行成功 [实际结果]: 用例执行失败
anolis8 5.10 x86 nightly存在同样问题 generic/193 - output mismatch (see /tmp/tone/run/xfstests/results//generic/193.out.bad) --- tests/generic/193.out 2023-08-22 11:13:46.418716615 +0800 +++ /tmp/tone/run/xfstests/results//generic/193.out.bad 2023-08-22 11:24:00.320592608 +0800 @@ -32,10 +32,10 @@ check that suid/sgid bits are cleared after successful chown... with no exec perm before: -rwSr-Sr-- -after: -rw-r-Sr-- +after: -rw-r--r-- with user exec perm before: -rwsr-Sr-- ... (Run 'diff -u /tmp/tone/run/xfstests/tests/generic/193.out /tmp/tone/run/xfstests/results//generic/193.out.bad' to see the entire diff) # uname -r 5.10.134-85.git.138a5871a7.an8.x86_64
5.10.134-16_rc1.al8内核依旧存在此问题; 失败日志如下: generic/193 - output mismatch (see /tmp/tone/run/xfstests/results//generic/193.out.bad) --- tests/generic/193.out 2023-10-11 10:39:31.902166582 +0800 +++ /tmp/tone/run/xfstests/results//generic/193.out.bad 2023-10-11 14:50:59.912712099 +0800 @@ -32,10 +32,10 @@ check that suid/sgid bits are cleared after successful chown... with no exec perm before: -rwSr-Sr-- -after: -rw-r-Sr-- +after: -rw-r--r-- with user exec perm before: -rwsr-Sr--
在016版本内部进行跟踪