[ "$SLOW" = "no" ] && EXCEPT_SLOW="24o 27m 64b 68 71 77f 78 115 124b 230d"
[ $(facet_fstype $SINGLEMDS) = "zfs" ] &&
-# bug number for skipped test: LU-1593 LU-2610 LU-2833 LU-1957 LU-2805
- ALWAYS_EXCEPT="$ALWAYS_EXCEPT 34h 40 48a 180 184c"
+# bug number for skipped test: LU-1593 LU-2833 LU-1957 LU-2805
+ ALWAYS_EXCEPT="$ALWAYS_EXCEPT 34h 48a 180 184c"
FAIL_ON_ERROR=false
stop mds${mds_index}
do_facet mds${mds_index} $cmd || rc=$?
- start mds${mds_index} $devname $MDS_MOUNT_OPTS
+ start mds${mds_index} $devname $MDS_MOUNT_OPTS || error "start failed"
df $MOUNT > /dev/null 2>&1
[ $rc -ne 0 ] && error "e2fsck should not report error upon "\
"short/long symlink MDT: rc=$rc"
stop mds${mdt_index}
do_facet mds${mdt_index} $cmd || rc=$?
- start mds${mdt_index} $devname $MDS_MOUNT_OPTS
+ start mds${mdt_index} $devname $MDS_MOUNT_OPTS ||
+ error "mount mds${mdt_index} failed"
df $MOUNT > /dev/null 2>&1
[ $rc -ne 0 ] && break
done
touch $WDIR/$tfile
stop mds${mdt_index}
- start mds${mdt_index} $mdtdevname $MDS_MOUNT_OPTS
+ start mds${mdt_index} $mdtdevname $MDS_MOUNT_OPTS ||
+ error "mount mds${mdt_index} failed"
#define OBD_FAIL_OSD_LMA_INCOMPAT 0x194
do_facet mds${mdt_index} lctl set_param fail_loc=0x194
run_test 133e "Verifying OST {read,write}_bytes nid stats ================="
test_133f() {
- local proc_dirs="/proc/fs/lustre/ /proc/sys/lnet/ /proc/sys/lustre/"
+ local proc_dirs
+
+ local dirs="/proc/fs/lustre/ /proc/sys/lnet/ /proc/sys/lustre/ \
+/sys/fs/lustre/ /sys/fs/lnet/"
+ local dir
+ for dir in $dirs; do
+ if [ -d $dir ]; then
+ proc_dirs="$proc_dirs $dir"
+ fi
+ done
+
local facet
remote_mds_nodsh && skip "remote MDS with nodsh" && return
run_test 133f "Check for LBUGs/Oopses/unreadable files in /proc"
test_133g() {
- local proc_dirs="/proc/fs/lustre/ /proc/sys/lnet/ /proc/sys/lustre/"
+ local proc_dirs
+
+ local dirs="/proc/fs/lustre/ /proc/sys/lnet/ /proc/sys/lustre/ \
+/sys/fs/lustre/ /sys/fs/lnet/"
+ local dir
+ for dir in $dirs; do
+ if [ -d $dir ]; then
+ proc_dirs="$proc_dirs $dir"
+ fi
+ done
+
local facet
# Second verifying readability.
# having "abc" as 1st arg, creates $TMP/lnet_abc.out and $TMP/lnet_abc.sys
create_lnet_proc_files() {
- cat /proc/sys/lnet/$1 >$TMP/lnet_$1.out || error "cannot read /proc/sys/lnet/$1"
+ lctl get_param -n $1 >$TMP/lnet_$1.out || error "cannot read lnet.$1"
sysctl lnet.$1 >$TMP/lnet_$1.sys_tmp || error "cannot read lnet.$1"
sed "s/^lnet.$1\ =\ //g" "$TMP/lnet_$1.sys_tmp" >$TMP/lnet_$1.sys
local L2 # regexp for 2nd line (optional)
local BR # regexp for the rest (body)
- # /proc/sys/lnet/stats should look as 11 space-separated non-negative numerics
+ # lnet.stats should look as 11 space-separated non-negative numerics
BR="^$N $N $N $N $N $N $N $N $N $N $N$"
create_lnet_proc_files "stats"
- check_lnet_proc_stats "stats.out" "/proc/sys/lnet/stats" "$BR"
check_lnet_proc_stats "stats.sys" "lnet.stats" "$BR"
remove_lnet_proc_files "stats"
- # /proc/sys/lnet/routes should look like this:
+ # lnet.routes should look like this:
# Routing disabled/enabled
# net hops priority state router
# where net is a string like tcp0, hops > 0, priority >= 0,
L2="^net +hops +priority +state +router$"
BR="^$NET +$N +(0|1) +(up|down) +$NID$"
create_lnet_proc_files "routes"
- check_lnet_proc_entry "routes.out" "/proc/sys/lnet/routes" "$BR" "$L1" "$L2"
check_lnet_proc_entry "routes.sys" "lnet.routes" "$BR" "$L1" "$L2"
remove_lnet_proc_files "routes"
- # /proc/sys/lnet/routers should look like this:
+ # lnet.routers should look like this:
# ref rtr_ref alive_cnt state last_ping ping_sent deadline down_ni router
# where ref > 0, rtr_ref > 0, alive_cnt >= 0, state is up/down,
# last_ping >= 0, ping_sent is boolean (0/1), deadline and down_ni are
L1="^ref +rtr_ref +alive_cnt +state +last_ping +ping_sent +deadline +down_ni +router$"
BR="^$P +$P +$N +(up|down) +$N +(0|1) +$I +$I +$NID$"
create_lnet_proc_files "routers"
- check_lnet_proc_entry "routers.out" "/proc/sys/lnet/routers" "$BR" "$L1"
check_lnet_proc_entry "routers.sys" "lnet.routers" "$BR" "$L1"
remove_lnet_proc_files "routers"
- # /proc/sys/lnet/peers should look like this:
+ # lnet.peers should look like this:
# nid refs state last max rtr min tx min queue
# where nid is a string like 192.168.1.1@tcp2, refs > 0,
# state is up/down/NA, max >= 0. last, rtr, min, tx, min are
L1="^nid +refs +state +last +max +rtr +min +tx +min +queue$"
BR="^$NID +$P +(up|down|NA) +$I +$N +$I +$I +$I +$I +$N$"
create_lnet_proc_files "peers"
- check_lnet_proc_entry "peers.out" "/proc/sys/lnet/peers" "$BR" "$L1"
check_lnet_proc_entry "peers.sys" "lnet.peers" "$BR" "$L1"
remove_lnet_proc_files "peers"
- # /proc/sys/lnet/buffers should look like this:
+ # lnet.buffers should look like this:
# pages count credits min
# where pages >=0, count >=0, credits and min are numeric (0 or >0 or <0)
L1="^pages +count +credits +min$"
BR="^ +$N +$N +$I +$I$"
create_lnet_proc_files "buffers"
- check_lnet_proc_entry "buffers.out" "/proc/sys/lnet/buffers" "$BR" "$L1"
check_lnet_proc_entry "buffers.sys" "lnet.buffers" "$BR" "$L1"
remove_lnet_proc_files "buffers"
- # /proc/sys/lnet/nis should look like this:
+ # lnet.nis should look like this:
# nid status alive refs peer rtr max tx min
# where nid is a string like 192.168.1.1@tcp2, status is up/down,
# alive is numeric (0 or >0 or <0), refs >= 0, peer >= 0,
L1="^nid +status +alive +refs +peer +rtr +max +tx +min$"
BR="^$NID +(up|down) +$I +$N +$N +$N +$N +$I +$I$"
create_lnet_proc_files "nis"
- check_lnet_proc_entry "nis.out" "/proc/sys/lnet/nis" "$BR" "$L1"
check_lnet_proc_entry "nis.sys" "lnet.nis" "$BR" "$L1"
remove_lnet_proc_files "nis"
- # can we successfully write to /proc/sys/lnet/stats?
- echo "0" >/proc/sys/lnet/stats || error "cannot write to /proc/sys/lnet/stats"
+ # can we successfully write to lnet.stats?
+ lctl set_param -n stats=0 || error "cannot write to lnet.stats"
sysctl -w lnet.stats=0 || error "cannot write to lnet.stats"
}
-run_test 215 "/proc/sys/lnet exists and has proper content - bugs 18102, 21079, 21517"
+run_test 215 "lnet exists and has proper content - bugs 18102, 21079, 21517"
test_216() { # bug 20317
[ $PARALLEL == "yes" ] && skip "skip parallel run" && return
touch $DIR/$tdir/$tfile || error "touch failed"
# OBD_FAIL_LLITE_XATTR_ENOMEM
$LCTL set_param fail_loc=0x1405
- if [ ! -f /etc/SuSE-release ]; then
+ # output of the form: attr 2 4 44 3 fc13 x86_64
+ V=($(IFS=".-" rpm -q attr))
+ if [[ ${V[1]} > 2 || ${V[2]} > 4 || ${V[3]} > 44 ||
+ ${V[1]} = 2 && ${V[2]} = 4 && ${V[3]} = 44 && ${V[4]} > 6 ]]; then
# attr pre-2.4.44-7 had a bug with rc
- # LU-3703 - SLES clients have older attr
+ # LU-3703 - SLES 11 and FC13 clients have older attr
getfattr -n user.attr $DIR/$tdir/$tfile &&
error "getfattr should have failed with ENOMEM"
+ else
+ skip "LU-3703: attr version $(getfattr --version) too old"
fi
$LCTL set_param fail_loc=0x0
rm -rf $DIR/$tdir
}
run_test 240 "race between ldlm enqueue and the connection RPC (no ASSERT)"
+test_241_bio() {
+ for LOOP in $(seq $1); do
+ dd if=$DIR/$tfile of=/dev/null bs=40960 count=1 2>/dev/null
+ cancel_lru_locks osc
+ done
+}
+
+test_241_dio() {
+ for LOOP in $(seq $1); do
+ dd if=$DIR/$tfile of=/dev/null bs=40960 count=1 \
+ iflag=direct 2>/dev/null
+ done
+}
+
+test_241() {
+ dd if=/dev/zero of=$DIR/$tfile count=1 bs=40960
+ ls -la $DIR/$tfile
+ cancel_lru_locks osc
+ test_241_bio 1000 &
+ PID=$!
+ test_241_dio 1000
+ wait $PID
+}
+run_test 241 "bio vs dio"
+
cleanup_test_300() {
trap 0
umask $SAVE_UMASK
local ls
#define OBD_FAIL_MGC_PAUSE_PROCESS_LOG 0x903
$LCTL set_param fail_loc=0x903
- # cancel_lru_locks mgc - does not work due to lctl set_param syntax
- for ls in /proc/fs/lustre/ldlm/namespaces/MGC*/lru_size; do
- echo "clear" > $ls
- done
+
+ cancel_lru_locks MGC
+
FAIL_ON_ERROR=true cleanup
FAIL_ON_ERROR=true setup
}