xfstest splats

Darrick J. Wong darrick.wong at oracle.com
Tue Apr 29 00:36:55 PDT 2014


Hi all,

I ran xfstests against tux3 on 3.15-rc3, with default options (primarily
because I don't know what options exist anyway).  xfstest generic/310 spit out
this:

 TUX3-fs error (sda): tux_readdir:398: zero length entry at inum 8192, block 15
 ------------[ cut here ]------------
 kernel BUG at /storage/home/djwong/cdev/work/linux-mcsum/fs/tux3/utility.c:111!
 invalid opcode: 0000 [#1] PREEMPT SMP
 Modules linked in: tux3 eeprom sch_fq_codel lpc_ich mfd_core fuse nfsd auth_rpcgss exportfs virtio_scsi af_packet
 CPU: 1 PID: 12398 Comm: t_readdir_2 Not tainted 3.15.0-rc3-mcsum #5
 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS Bochs 01/01/2011
 task: ffff88007c5dc890 ti: ffff880037608000 task.ti: ffff880037608000
 RIP: 0010:[<ffffffffa00b5cd7>]  [<ffffffffa00b5cd7>] __tux3_fs_error+0x67/0x70 [tux3]
 RSP: 0018:ffff880037609e10  EFLAGS: 00010292
 RAX: 000000000000004e RBX: ffff88007b01e09b RCX: 0000000000000000
 RDX: ffff88007fc8ee18 RSI: ffff88007fc8d208 RDI: 0000000000000246
 RBP: ffff880037609e68 R08: 0000000000000000 R09: 000000000000020c
 R10: 0000000000000050 R11: ffff880037609b3e R12: ffff880037609f20
 R13: 000000000000009b R14: ffff88007b01eff0 R15: ffff88007b872d08
 FS:  00007fbc6e919740(0000) GS:ffff88007fc80000(0000) knlGS:0000000000000000
 CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
 CR2: 00000000014e8000 CR3: 000000007b4e6000 CR4: 00000000001406e0
 Stack:
  ffffffffa00bb7c0 ffff880037609e20 0000000000000020 ffff880037609e78
  ffff880037609e38 00000000000200d0 0000000000000000 ffff880037609f20
  000000000000009b 0000000000002000 000000000000000f ffff880037609ed8
 Call Trace:
  [<ffffffffa00a9ce8>] tux_readdir+0x298/0x300 [tux3]
  [<ffffffff811a128d>] iterate_dir+0x7d/0xb0
  [<ffffffff811a165a>] SyS_getdents+0x8a/0x110
  [<ffffffff811a1370>] ? fillonedir+0xb0/0xb0
  [<ffffffff8118e641>] ? SyS_lseek+0x91/0xb0
  [<ffffffff8158dded>] system_call_fastpath+0x1a/0x1f
 Code: 48 89 4c 24 08 89 d1 48 89 c2 48 89 74 24 20 48 8b b7 00 15 00 00 31 c0 48 c7 c7 98 c3 0b a0 48 81 c6 c0 02 00 00 e8 6d eb 4c e1 <0f> 0b 0f 1f 80 00 00 00 00 66 66 66 66 90 55 48 89 e5 48 83 ec
 RIP  [<ffffffffa00b5cd7>] __tux3_fs_error+0x67/0x70 [tux3]
  RSP <ffff880037609e10>
 ---[ end trace 657aee061636a535 ]---

Attached is a wrapper script I use to run xfstests.  You probably want to
change the paths that start with /djwong (private build directory) to match
wherever you build xfstests.  Also just as a warning this script was hastily
ported from the ext4 version of the script.

# TEST_DEV=/dev/sda SCRATCH_DEV=/dev/sdb /djwong/t/xfstest.sh

--D

#!/bin/bash

DIR="$(dirname "$0")"

if [ "$1" = "--help" ]; then
	echo "Usage: $0 xfstest_names"
	echo "Variables: TEST_DEV TEST_DIR SCRATCH_DEV SCRATCH_DIR STRACE=y"
	exit 0
fi

if [ -z "${BLK_SZ}" ]; then
	BLK_SZ=4096
fi

if [ -z "${TEST_DEV}" -a -b /dev/vda ]; then
	TEST_DEV=/dev/vda
	export TEST_DEV
fi
if [ -z "${TEST_DIR}" -a -n "${TEST_DEV}" ]; then
	TEST_DIR=/mnt
	export TEST_DIR
fi
if [ -z "${SCRATCH_DEV}" -a -b /dev/vdb ]; then
	SCRATCH_DEV=/dev/vdb
	export SCRATCH_DEV
fi
if [ -z "${SCRATCH_MNT}" -a -n "${SCRATCH_DEV}" ]; then
	SCRATCH_MNT=/opt
	export SCRATCH_MNT
fi

# Pretend to check arguments
if [ ! -b "${TEST_DEV}" -o ! -d "${TEST_DIR}" ]; then
	echo "Need to set TEST_DEV and TEST_DIR."
	exit 1
fi

if [ -b "${SCRATCH_DEV}" -a ! -d "${SCRATCH_MNT}" ]; then
	echo "SCRATCH_MNT is not a dir?"
	exit 1
fi

if [ ! -b "${SCRATCH_DEV}" -a -d "${SCRATCH_MNT}" ]; then
	echo "SCRATCH_DEV is not a blockdev?"
	exit 1
fi

if [ "${STRACE}" = "y" ]; then
	STRACE="strace -f -o /tmp/xfstest.log -s 512"
fi

# Copy and patch xfstests...
if [ ! -d /tmp/xfstests ]; then
	cp -pRdu "${DIR}/../xfstests-bld/xfstests-dev" /tmp/xfstests
fi

function undo_bindmounts {
	umount /sbin/fs/
	umount /etc/passwd
	umount /etc/group
	umount /etc/shadow
}
undo_bindmounts 2> /dev/null
trap 'undo_bindmounts' EXIT

# Stick in our replacement files <cough>
cat /etc/passwd > /tmp/m00
echo "fsgqa:x:24576:24576::${TEST_DIR}:/bin/bash" >> /tmp/m00
mount /tmp/m00 /etc/passwd --bind
cat /etc/group > /tmp/m01
echo "fsgqa:x:24576:fsgqa" >> /tmp/m01
mount /tmp/m01 /etc/group --bind
cat /etc/shadow > /tmp/m02
echo "fsgqa:*:15659:0:99999:7:::" >> /tmp/m02
mount /tmp/m02 /etc/shadow --bind

if [ ! -d /sbin/fs/ ]; then
	echo "/sbin/fs/ is not a dir?"
	exit 1
fi
mount -t tmpfs none /sbin/fs/

cat > /sbin/fs/fsck.tux3 << ENDL
#!/bin/bash

for arg in "\$@"; do
	if [ -b "\${arg}" ]; then
		dev="\${arg}"
	fi
done
exec /djwong/tux3/user/tux3 fsck "\${dev}"
ENDL
chmod +x /sbin/fs/fsck.tux3

cat > /sbin/fs/mkfs.tux3 << ENDL
#!/bin/bash

exec /djwong/tux3/user/tux3 mkfs "\$@"
ENDL
chmod +x /sbin/fs/mkfs.tux3

# Run test
cd /tmp/xfstests
rm -rf /tmp/fail.log
trap 'break' TERM

PATH="/sbin/fs/:${PATH}"
export PATH
FSTYP=tux3
export FSTYP
function run_stuff {
	while read tst; do
		if [ ! -e "/tmp/xfstests/tests/${tst}" ]; then
			continue
		fi

		test -x /usr/bin/figlet && figlet -f mono9 -w 132 "${tst}"
		test -x /usr/bin/figlet || echo "TEST: ${tst}"
		echo "TEST: ${tst} @ $(date)" > /dev/ttyprintk

		# Format everything...
		umount "${TEST_DIR}"
		echo y | mkfs.tux3 "${TEST_DEV}"
		mount "${TEST_DEV}" "${TEST_DIR}"

		if [ -d "${SCRATCH_MNT}" -a -b "${SCRATCH_DEV}" ]; then
			umount "${SCRATCH_MNT}"
			echo y | mkfs.tux3 "${SCRATCH_DEV}" 
			mount "${SCRATCH_DEV}" "${SCRATCH_MNT}"
		fi

		# and test
		${STRACE} ./check "${tst}"
		RET=$?
		if [ -f "/tmp/xfstests/results/${tst}.out.bad" ]; then
			echo "Test ${tst} FAILED with code ${RET}" >> /tmp/fail.log
			diff -u /tmp/xfstests/tests/${tst}.out /tmp/xfstests/results/${tst}.out.bad >> /tmp/fail.log
			echo >> /tmp/fail.log
		fi
	done
}

if [ "${#@}" -gt 0 ]; then
	for tst in "$@"; do
		echo "${tst}"
	done | run_stuff
else
	(
	seq -w 1 322 | awk '{printf("generic/%s\n", $1);}';
	seq -w 1 305 | awk '{printf("shared/%s\n", $1);}'
	) | run_stuff
fi

FAILURES="$(cat /tmp/fail.log | wc -l)"
if [ "${FAILURES}" -gt 0 ]; then
	cat /tmp/fail.log
	exit 1
fi
exit 0



More information about the Tux3 mailing list