mirror_zfs/scripts/check.sh
behlendo c30df9c863 Fixes:
1) Ensure mutex_init() never fails in the case of ENOMEM by retrying
   forever.  I don't think I've ever seen this happen but it was clear
   after code inspection that if it did we would immediately crash.

2) Enable full debugging in check.sh for sanity tests.  Might as well
   get as much debug as we can in the case of a failure.

3) Reworked list of kmem caches tracked by SPL in to a hash with the
   key based on the address of the kmem_cache_t.  This should speed
   up the constructor/destructor/shrinker lookup needed now for newer
   kernel which removed the destructor support.

4) Updated kmem_cache_create to handle the case where CONFIG_SLUB
   is defined.  The slub would occasionally merge slab caches which
   resulted in non-unique keys for our hash lookup in 3).  To fix this
   we detect if the slub is enabled and then set the needed flag
   to prevent this merging from ever occuring.

5) New kernels removed the proc_dir_entry pointer from items
   registered by sysctl.  This means we can no long be sneaky and
   manually insert things in to the sysctl tree simply by walking
   the proc tree.  So I'm forced to create a seperate tree for
   all the things I can't easily support via sysctl interface.
   I don't like it but it will do for now.



git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@124 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
2008-06-04 06:00:46 +00:00

57 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
prog=check.sh
spl_module=../modules/spl/spl.ko
splat_module=../modules/splat/splat.ko
splat_cmd=../cmd/splat
verbose=
die() {
echo "${prog}: $1" >&2
exit 1
}
warn() {
echo "${prog}: $1" >&2
}
if [ -n "$V" ]; then
verbose="-v"
fi
if [ -n "$TESTS" ]; then
tests="$TESTS"
else
tests="-a"
fi
if [ $(id -u) != 0 ]; then
die "Must run as root"
fi
if /sbin/lsmod | egrep -q "^spl|^splat"; then
die "Must start with spl modules unloaded"
fi
if [ ! -f ${spl_module} ] || [ ! -f ${splat_module} ]; then
die "Source tree must be built, run 'make'"
fi
spl_module_params="spl_debug_mask=-1 spl_debug_subsys=-1"
echo "Loading ${spl_module}"
/sbin/insmod ${spl_module} ${spl_module_params} || die "Failed to load ${spl_module}"
echo "Loading ${splat_module}"
/sbin/insmod ${splat_module} || die "Unable to load ${splat_module}"
while [ ! -c /dev/splatctl ]; do sleep 0.1; done
$splat_cmd $tests $verbose
echo "Unloading ${splat_module}"
/sbin/rmmod ${splat_module} || die "Failed to unload ${splat_module}"
echo "Unloading ${spl_module}"
/sbin/rmmod ${spl_module} || die "Unable to unload ${spl_module}"
exit 0