CLEANUP=${CLEANUP:-""}
cleanup_and_setup_lustre
+assert_DIR
rm -rf $DIR/[df][0-9]*
SAMPLE_NAME=recovery-small.junk
#b=2494
test_12(){
$LCTL mark multiop $MOUNT/$tfile OS_c
- do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x115"
+ do_facet $SINGLEMDS "lctl set_param fail_loc=0x115"
clear_failloc $SINGLEMDS $((TIMEOUT * 2)) &
multiop_bg_pause $MOUNT/$tfile OS_c || return 1
PID=$!
mkdir $MOUNT/readdir || return 1
touch $MOUNT/readdir/newentry || return
# OBD_FAIL_MDS_READPAGE_NET|OBD_FAIL_ONCE
- do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000104"
+ do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000104"
ls $MOUNT/readdir || return 3
- do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0"
+ do_facet $SINGLEMDS "lctl set_param fail_loc=0"
rm -rf $MOUNT/readdir || return 4
}
run_test 13 "mdc_readpage restart test (bug 1138)"
mkdir $MOUNT/readdir
touch $MOUNT/readdir/newentry
# OBD_FAIL_MDS_SENDPAGE|OBD_FAIL_ONCE
- do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000106"
+ do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000106"
ls $MOUNT/readdir || return 1
- do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0"
+ do_facet $SINGLEMDS "lctl set_param fail_loc=0"
}
run_test 14 "mdc_readpage resend test (bug 1138)"
test_15() {
- do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000128"
+ do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000128"
touch $DIR/$tfile && return 1
return 0
}
stop_read_ahead
#define OBD_FAIL_PTLRPC_BULK_PUT_NET 0x504 | OBD_FAIL_ONCE
- do_facet ost1 "sysctl -w lustre.fail_loc=0x80000504"
+ do_facet ost1 "lctl set_param fail_loc=0x80000504"
cancel_lru_locks osc
# OST bulk will time out here, client resends
do_facet client "cmp /etc/termcap $MOUNT/termcap" || return 1
- do_facet ost1 sysctl -w lustre.fail_loc=0
+ do_facet ost1 lctl set_param fail_loc=0
# give recovery a chance to finish (shouldn't take long)
sleep $TIMEOUT
do_facet client "cmp /etc/termcap $MOUNT/termcap" || return 2
test_17() {
# OBD_FAIL_PTLRPC_BULK_GET_NET 0x0503 | OBD_FAIL_ONCE
# OST bulk will time out here, client retries
- do_facet ost1 sysctl -w lustre.fail_loc=0x80000503
+ do_facet ost1 lctl set_param fail_loc=0x80000503
# need to ensure we send an RPC
do_facet client cp /etc/termcap $DIR/$tfile
sync
sleep $TIMEOUT
- do_facet ost1 sysctl -w lustre.fail_loc=0
+ do_facet ost1 lctl set_param fail_loc=0
do_facet client "df $DIR"
# expect cmp to succeed, client resent bulk
do_facet client "cmp /etc/termcap $DIR/$tfile" || return 3
# OBD_FAIL_OST_CONNECT_NET2
# lost reply to connect request
- do_facet ost1 sysctl -w lustre.fail_loc=0x80000225
+ do_facet ost1 lctl set_param fail_loc=0x80000225
# force reconnect
df $MOUNT > /dev/null 2>&1
sleep 2
test_20a() { # bug 2983 - ldlm_handle_enqueue cleanup
mkdir -p $DIR/$tdir
+ lfs setstripe $DIR/$tdir/${tfile} -i 0 -c 1
multiop_bg_pause $DIR/$tdir/${tfile} O_wc || return 1
MULTI_PID=$!
cancel_lru_locks osc
#define OBD_FAIL_LDLM_ENQUEUE_EXTENT_ERR 0x308
- do_facet ost1 sysctl -w lustre.fail_loc=0x80000308
+ do_facet ost1 lctl set_param fail_loc=0x80000308
kill -USR1 $MULTI_PID
wait $MULTI_PID
rc=$?
test_20b() { # bug 2986 - ldlm_handle_enqueue error during open
mkdir -p $DIR/$tdir
- touch $DIR/$tdir/${tfile}
+ lfs setstripe $DIR/$tdir/${tfile} -i 0 -c 1
cancel_lru_locks osc
#define OBD_FAIL_LDLM_ENQUEUE_EXTENT_ERR 0x308
- do_facet ost1 sysctl -w lustre.fail_loc=0x80000308
+ do_facet ost1 lctl set_param fail_loc=0x80000308
dd if=/etc/hosts of=$DIR/$tdir/$tfile && \
error "didn't fail open enqueue" || true
}
multiop_bg_pause $DIR/$tdir-1/f O_c || return 1
close_pid=$!
- do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000129"
+ do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000129"
multiop $DIR/$tdir-2/f Oc &
open_pid=$!
sleep 1
- do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0"
+ do_facet $SINGLEMDS "lctl set_param fail_loc=0"
- do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000115"
+ do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000115"
kill -USR1 $close_pid
cancel_lru_locks mdc
wait $close_pid || return 1
wait $open_pid || return 2
- do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0"
+ do_facet $SINGLEMDS "lctl set_param fail_loc=0"
$CHECKSTAT -t file $DIR/$tdir-1/f || return 3
$CHECKSTAT -t file $DIR/$tdir-2/f || return 4
multiop_bg_pause $DIR/$tdir-1/f O_c || return 1
close_pid=$!
- do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000107"
+ do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000107"
mcreate $DIR/$tdir-2/f &
open_pid=$!
sleep 1
- do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0"
+ do_facet $SINGLEMDS "lctl set_param fail_loc=0"
kill -USR1 $close_pid
cancel_lru_locks mdc
multiop_bg_pause $DIR/$tdir-1/f O_c || return 1
close_pid=$!
- do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000107"
+ do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000107"
mcreate $DIR/$tdir-2/f &
open_pid=$!
sleep 3
- do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0"
+ do_facet $SINGLEMDS "lctl set_param fail_loc=0"
- do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000115"
+ do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000115"
kill -USR1 $close_pid
cancel_lru_locks mdc
wait $close_pid || return 1
wait $open_pid || return 2
- do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0"
+ do_facet $SINGLEMDS "lctl set_param fail_loc=0"
$CHECKSTAT -t file $DIR/$tdir-1/f || return 2
$CHECKSTAT -t file $DIR/$tdir-2/f || return 3
multiop_bg_pause $DIR/$tdir-1/f O_c || return 1
pid=$!
- do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000129"
+ do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000129"
multiop $DIR/$tdir-2/f Oc &
sleep 1
- do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0"
+ do_facet $SINGLEMDS "lctl set_param fail_loc=0"
- do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000122"
+ do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000122"
kill -USR1 $pid
cancel_lru_locks mdc
wait $pid || return 1
- do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0"
+ do_facet $SINGLEMDS "lctl set_param fail_loc=0"
$CHECKSTAT -t file $DIR/$tdir-1/f || return 2
$CHECKSTAT -t file $DIR/$tdir-2/f || return 3
multiop_bg_pause $DIR/$tdir-1/f O_c || return 1
pid=$!
- do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000119"
+ do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000119"
touch $DIR/$tdir-2/f &
sleep 1
- do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0"
+ do_facet $SINGLEMDS "lctl set_param fail_loc=0"
kill -USR1 $pid
cancel_lru_locks mdc
multiop_bg_pause $DIR/$tdir-1/f O_c || return 1
pid=$!
- do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000119"
+ do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000119"
touch $DIR/$tdir-2/f &
sleep 1
- do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0"
+ do_facet $SINGLEMDS "lctl set_param fail_loc=0"
- do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000122"
+ do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000122"
kill -USR1 $pid
cancel_lru_locks mdc
wait $pid || return 1
- do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0"
+ do_facet $SINGLEMDS "lctl set_param fail_loc=0"
$CHECKSTAT -t file $DIR/$tdir-1/f || return 2
$CHECKSTAT -t file $DIR/$tdir-2/f || return 3
multiop_bg_pause $DIR/$tdir-1/f O_c || return 1
pid=$!
- do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000119"
+ do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000119"
touch $DIR/$tdir-2/f &
sleep 1
- do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0"
+ do_facet $SINGLEMDS "lctl set_param fail_loc=0"
- do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000115"
+ do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000115"
kill -USR1 $pid
cancel_lru_locks mdc
wait $pid || return 1
- do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0"
+ do_facet $SINGLEMDS "lctl set_param fail_loc=0"
$CHECKSTAT -t file $DIR/$tdir-1/f || return 2
$CHECKSTAT -t file $DIR/$tdir-2/f || return 3
multiop_bg_pause $DIR/$tdir-1/f O_c || return 1
pid=$!
- do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000107"
+ do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000107"
touch $DIR/$tdir-2/f &
touch_pid=$!
sleep 1
- do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0"
+ do_facet $SINGLEMDS "lctl set_param fail_loc=0"
- do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000122"
+ do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000122"
cancel_lru_locks mdc
kill -USR1 $pid
wait $pid || return 1
- do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0"
+ do_facet $SINGLEMDS "lctl set_param fail_loc=0"
wait $touch_pid || return 2
f1=$DIR/${tfile}-1
f2=$DIR/${tfile}-2
- do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000115"
+ do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000115"
multiop $f2 Oc &
close_pid=$!
multiop $f1 msu || return 1
cancel_lru_locks mdc
- do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0"
+ do_facet $SINGLEMDS "lctl set_param fail_loc=0"
wait $close_pid || return 2
rm -rf $f2 || return 4
kill -USR1 $MULTI_PID
wait $MULTI_PID
rc=$?
- sysctl -w lustre.fail_loc=0x0
+ lctl set_param fail_loc=0x0
client_reconnect
[ $rc -eq 0 ] && error_ignore 5494 "multiop didn't fail fsync: rc $rc" || true
}
OST_NEXP1=`echo $OST_EXP | cut -d' ' -f2`
echo starting with $OST_NEXP1 OST exports
# OBD_FAIL_PTLRPC_DROP_RPC 0x505
- do_facet client sysctl -w lustre.fail_loc=0x505
+ do_facet client lctl set_param fail_loc=0x505
# evictor takes up to 2.25x to evict. But if there's a
# race to start the evictor from various obds, the loser
# might have to wait for the next ping.
OST_EXP="`do_facet ost1 lctl get_param -n $OST_FILE`"
OST_NEXP2=`echo $OST_EXP | cut -d' ' -f2`
echo ending with $OST_NEXP2 OST exports
- do_facet client sysctl -w lustre.fail_loc=0x0
+ do_facet client lctl set_param fail_loc=0x0
[ $OST_NEXP1 -le $OST_NEXP2 ] && error "client not evicted"
return 0
}
FAILURE_MODE="SOFT"
facet_failover $SINGLEMDS
#define OBD_FAIL_OSC_SHUTDOWN 0x407
- sysctl -w lustre.fail_loc=0x80000407
+ lctl set_param fail_loc=0x80000407
# need to wait for reconnect
echo -n waiting for fail_loc
- while [ `sysctl -n lustre.fail_loc` -eq -2147482617 ]; do
+ while [ `lctl get_param -n fail_loc` -eq -2147482617 ]; do
sleep 1
echo -n .
done
do_facet client mcreate $MOUNT/$tfile || return 1
drop_bl_callback "chmod 0777 $MOUNT/$tfile" ||echo "evicted as expected"
#define OBD_FAIL_MDS_CLIENT_ADD 0x12f
- do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x8000012f"
+ do_facet $SINGLEMDS "lctl set_param fail_loc=0x8000012f"
# fail once (evicted), reconnect fail (fail_loc), ok
df || (sleep 10; df) || (sleep 10; df) || error "reconnect failed"
rm -f $MOUNT/$tfile
run_test 51 "failover MDS during recovery"
test_52_guts() {
+ do_facet client "mkdir -p $DIR/$tdir"
do_facet client "writemany -q -a $DIR/$tdir/$tfile 300 5" &
CLIENT_PID=$!
echo writemany pid $CLIENT_PID
echo "(dd_pid=$DDPID, time=$count)successful"
#define OBD_FAIL_OST_DROP_REQ 0x21d
- do_facet ost sysctl -w lustre.fail_loc=0x0000021d
+ do_facet ost lctl set_param fail_loc=0x0000021d
# second dd will be never finished
dd if=/dev/zero of=$DIR/$tdir/$tfile-2 bs=32M count=4 &
DDPID=$!
echo "(dd_pid=$DDPID, time=$count)successful"
#Recover fail_loc and dd will finish soon
- do_facet ost sysctl -w lustre.fail_loc=0
+ do_facet ost lctl set_param fail_loc=0
count=0
echo "step3: testing ......"
while [ true ]; do
test_56() { # b=11277
#define OBD_FAIL_MDS_RESEND 0x136
touch $DIR/$tfile
- do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000136"
+ do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000136"
stat $DIR/$tfile
- do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0"
+ do_facet $SINGLEMDS "lctl set_param fail_loc=0"
rm -f $DIR/$tfile
}
run_test 56 "do not allow reconnect to busy exports"
pid=$!
sleep 1
#define OBD_FAIL_LPROC_REMOVE 0xB00
- sysctl -w lustre.fail_loc=0x80000B00
+ lctl set_param fail_loc=0x80000B00
zconf_umount `hostname` $DIR
- sysctl -w lustre.fail_loc=0x80000B00
+ lctl set_param fail_loc=0x80000B00
fail_abort $SINGLEMDS
kill -9 $pid
- sysctl -w lustre.fail_loc=0
+ lctl set_param fail_loc=0
mount_client $DIR
do_facet client "df $DIR"
}
#define OBD_FAIL_MDC_ENQUEUE_PAUSE 0x801
touch $MOUNT/$tfile
ls -la $MOUNT/$tfile
- sysctl -w lustre.fail_loc=0x80000801
+ lctl set_param fail_loc=0x80000801
cp $MOUNT/$tfile /dev/null &
pid=$!
sleep 1
- sysctl -w lustre.fail_loc=0
+ lctl set_param fail_loc=0
drop_bl_callback rm -f $MOUNT/$tfile
wait $pid
do_facet client "df $DIR"
zconf_mount `hostname` $MOUNT2 || error "Failed to mount $MOUNT2"
echo $DIR2 | grep -q $MOUNT2 || error "DIR2 is not set properly: $DIR2"
#define OBD_FAIL_LDLM_CANCEL_EVICT_RACE 0x311
- sysctl -w lustre.fail_loc=0x311
+ lctl set_param fail_loc=0x311
writes=$(LANG=C dd if=/dev/zero of=$DIR2/$tfile count=1 2>&1)
[ $? = 0 ] || error "dd write failed"
writes=$(echo $writes | awk -F '+' '/out/ {print $1}')
- sysctl -w lustre.fail_loc=0
+ lctl set_param fail_loc=0
sync
zconf_umount `hostname` $MOUNT2 -f
reads=$(LANG=C dd if=$DIR/$tfile of=/dev/null 2>&1)