[ "$TMP" ] || TMP=/tmp
[ "$COUNT" ] || COUNT=1000
[ "$DEBUG_LVL" ] || DEBUG_LVL=0
-[ "$DEBUG_OFF" ] || DEBUG_OFF="eval sysctl -w lnet.debug=\"$DEBUG_LVL\""
-[ "$DEBUG_ON" ] || DEBUG_ON="eval sysctl -w lnet.debug=0x33f0484"
+[ "$DEBUG_OFF" ] || DEBUG_OFF="eval lctl set_param debug=\"$DEBUG_LVL\""
+[ "$DEBUG_ON" ] || DEBUG_ON="eval lctl set_param debug=0x33f0484"
export TESTSUITE_LIST="RUNTESTS SANITY DBENCH BONNIE IOZONE FSX SANITYN LFSCK LIBLUSTRE REPLAY_SINGLE CONF_SANITY RECOVERY_SMALL REPLAY_OST_SINGLE REPLAY_DUAL INSANITY SANITY_QUOTA SANITY_SEC"
start_mds
#define OBD_FAIL_PTLRPC_DELAY_SEND 0x506
- do_facet client "sysctl -w lustre.fail_loc=0x80000506"
+ do_facet client "lctl set_param fail_loc=0x80000506"
grep " $MOUNT " /etc/mtab && echo "test 5e: mtab before mount" && return 10
mount_client $MOUNT || echo "mount failed (not fatal)"
cleanup || return $?
test_9() {
start_ost
- do_facet ost1 sysctl lnet.debug=\'inode trace\' || return 1
- do_facet ost1 sysctl lnet.subsystem_debug=\'mds ost\' || return 1
+ do_facet ost1 lctl set_param debug=\'inode trace\' || return 1
+ do_facet ost1 lctl set_param subsystem_debug=\'mds ost\' || return 1
- CHECK_PTLDEBUG="`do_facet ost1 sysctl -n lnet.debug`"
+ CHECK_PTLDEBUG="`do_facet ost1 lctl get_param -n debug`"
if [ "$CHECK_PTLDEBUG" ] && [ "$CHECK_PTLDEBUG" = "trace inode" ];then
echo "lnet.debug success"
else
echo "lnet.debug: want 'trace inode', have '$CHECK_PTLDEBUG'"
return 1
fi
- CHECK_SUBSYS="`do_facet ost1 sysctl -n lnet.subsystem_debug`"
+ CHECK_SUBSYS="`do_facet ost1 lctl get_param -n subsystem_debug`"
if [ "$CHECK_SUBSYS" ] && [ "$CHECK_SUBSYS" = "mds ost" ]; then
echo "lnet.subsystem_debug success"
else
start_ost
start_mds
# Simulate -EINTR during mount OBD_FAIL_LDLM_CLOSE_THREAD
- sysctl -w lustre.fail_loc=0x80000313
+ lctl set_param fail_loc=0x80000313
mount_client $MOUNT
cleanup
}
# we need modules before mount for sysctl, so make sure...
do_facet mds "lsmod | grep -q lustre || modprobe lustre"
#define OBD_FAIL_MDS_FS_SETUP 0x135
- do_facet mds "sysctl -w lustre.fail_loc=0x80000135"
+ do_facet mds "lctl set_param fail_loc=0x80000135"
start_mds && echo MDS started && return 1
lctl get_param -n devices
DEVS=$(lctl get_param -n devices | wc -l)
local tmpdir=$TMP/conf32a
unzip -o -j -d $tmpdir $DISK1_4 || { skip "Cant unzip $DISK1_4, skipping" && return ; }
load_modules
- sysctl lnet.debug=$PTLDEBUG
+ lctl set_param debug=$PTLDEBUG
$TUNEFS $tmpdir/mds || error "tunefs failed"
# nids are wrong, so client wont work, but server should start
local tmpdir=$TMP/conf32b
unzip -o -j -d $tmpdir $DISK1_4 || { skip "Cant unzip $DISK1_4, skipping" && return ; }
load_modules
- sysctl lnet.debug=$PTLDEBUG
+ lctl set_param debug=$PTLDEBUG
NEWNAME=sofia
# writeconf will cause servers to register with their current nids
do_facet client dd if=/dev/zero of=$MOUNT/24 bs=1024k count=1
# Drop lock cancelation reply during umount
#define OBD_FAIL_LDLM_CANCEL 0x304
- do_facet client sysctl -w lustre.fail_loc=0x80000304
- #sysctl -w lnet.debug=-1
+ do_facet client lctl set_param fail_loc=0x80000304
+ #lctl set_param debug=-1
umount_client $MOUNT
cleanup
}
test_35() { # bug 12459
setup
- DBG_SAVE="`sysctl -n lnet.debug`"
- sysctl -w lnet.debug="ha"
+ DBG_SAVE="`lctl get_param -n debug`"
+ lctl set_param debug="ha"
log "Set up a fake failnode for the MDS"
FAKENID="127.0.0.2"
log "Wait for df ($DFPID) ... "
wait $DFPID
log "done"
- sysctl -w lnet.debug="$DBG_SAVE"
+ lctl set_param debug="$DBG_SAVE"
# retrieve from the log the first server that the client tried to
# contact after the connection loss
log "== test 00: target handle mismatch (bug 5317) === `date +%H:%M:%S`"
#define OBD_FAIL_OST_ALL_REPLY_NET 0x211
- do_facet ost "sysctl -w lustre.fail_loc=0x80000211"
+ do_facet ost "lctl set_param fail_loc=0x80000211"
zconf_mount `hostname` $MOUNT && df $MOUNT && pass || error "mount fail"
fi
#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
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=$?
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
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)
mcreate $MOUNT1/$tfile-1
mcreate $MOUNT2/$tfile-2
# drop first reint reply
- do_facet $SINGLEMDS sysctl -w lustre.fail_loc=0x80000119
+ do_facet $SINGLEMDS lctl set_param fail_loc=0x80000119
fail $SINGLEMDS
- do_facet $SINGLEMDS sysctl -w lustre.fail_loc=0
+ do_facet $SINGLEMDS lctl set_param fail_loc=0
rm $MOUNT1/$tfile-[1,2] || return 1
munlink $MOUNT1/$tfile-1
mcreate $MOUNT2/$tfile-2
# drop first reint reply
- do_facet $SINGLEMDS sysctl -w lustre.fail_loc=0x80000119
+ do_facet $SINGLEMDS lctl set_param fail_loc=0x80000119
fail $SINGLEMDS
- do_facet $SINGLEMDS sysctl -w lustre.fail_loc=0
+ do_facet $SINGLEMDS lctl set_param fail_loc=0
checkstat $MOUNT1/$tfile-1 && return 1
checkstat $MOUNT1/$tfile-2 || return 2
mcreate $MOUNT2/$tfile-4
mcreate $MOUNT1/$tfile-5
# drop all reint replies for a while
- do_facet $SINGLEMDS sysctl -w lustre.fail_loc=0x0119
+ do_facet $SINGLEMDS lctl set_param fail_loc=0x0119
# note that with this fail_loc set, facet_failover df will fail
facet_failover $SINGLEMDS
#sleep for while, let both clients reconnect and timeout
sleep $((TIMEOUT * 2))
- do_facet $SINGLEMDS sysctl -w lustre.fail_loc=0
+ do_facet $SINGLEMDS lctl set_param fail_loc=0
rm $MOUNT1/$tfile-[1-5] || return 1
MULTIPID=$!
#define OBD_FAIL_LDLM_ENQUEUE 0x302
- do_facet $SINGLEMDS sysctl -w lustre.fail_loc=0x80000302
+ do_facet $SINGLEMDS lctl set_param fail_loc=0x80000302
facet_failover $SINGLEMDS
- do_facet $SINGLEMDS sysctl -w lustre.fail_loc=0
+ do_facet $SINGLEMDS lctl set_param fail_loc=0
df $MOUNT || return 1
ls $DIR/$tfile
wait $MULTIPID || return 4
# drop close
- do_facet $SINGLEMDS sysctl -w lustre.fail_loc=0x80000115
+ do_facet $SINGLEMDS lctl set_param fail_loc=0x80000115
facet_failover $SINGLEMDS
- do_facet $SINGLEMDS sysctl -w lustre.fail_loc=0
+ do_facet $SINGLEMDS lctl set_param fail_loc=0
df $MOUNT || return 1
ls $DIR/$tfile
echo "data" > "$MOUNT2/${tfile}-m2"
umount $MOUNT2
- do_facet ost1 "sysctl -w lustre.fail_loc=0x80000802"
+ do_facet ost1 "lctl set_param fail_loc=0x80000802"
facet_failover $SINGLEMDS
df $MOUNT || return 1
- do_facet ost1 "sysctl -w lustre.fail_loc=0"
+ do_facet ost1 "lctl set_param fail_loc=0"
zconf_mount `hostname` $MOUNT2 || error "mount $MOUNT2 fail"
return 0
statmany -s $MOUNT1/$tdir/f 1 500 &
OPENPID=$!
NOW=`date +%s`
- do_facet $SINGLEMDS sysctl -w lustre.fail_loc=0x8000030b # hold enqueue
+ do_facet $SINGLEMDS lctl set_param fail_loc=0x8000030b # hold enqueue
sleep 1
#define OBD_FAIL_LDLM_BL_CALLBACK 0x305
- do_facet client sysctl -w lustre.fail_loc=0x80000305 # drop cb, evict
+ do_facet client lctl set_param fail_loc=0x80000305 # drop cb, evict
cancel_lru_locks mdc
usleep 500 # wait to ensure first client is one that will be evicted
openfile -f O_RDONLY $MOUNT2/$tdir/f0
wait $OPENPID
dmesg | grep "entering recovery in server" && \
error "client not evicted" || true
- do_facet client "sysctl -w lustre.fail_loc=0"
- do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0"
+ do_facet client "lctl set_param fail_loc=0"
+ do_facet $SINGLEMDS "lctl set_param fail_loc=0"
}
run_test 18 "ldlm_handle_enqueue succeeds on evicted export (3822)"
zconf_umount `hostname` $MOUNT -f
# needs to run during initial client->OST connection
#define OBD_FAIL_OST_ALL_REPLY_NET 0x211
- do_facet ost "sysctl -w lustre.fail_loc=0x80000211"
+ do_facet ost "lctl set_param fail_loc=0x80000211"
zconf_mount `hostname` $MOUNT && df $MOUNT || error "0a mount fail"
}
run_test 0a "target handle mismatch (bug 5317) `date +%H:%M:%S`"
sleep 2 # ensure we have a fresh statfs
sync
#define OBD_FAIL_MDS_REINT_NET_REP 0x119
- do_facet mds "sysctl -w lustre.fail_loc=0x80000119"
+ do_facet mds "lctl set_param fail_loc=0x80000119"
after_dd=`kbytesfree`
log "before: $before after_dd: $after_dd"
(( $before > $after_dd )) || return 1
CLEANUP=${CLEANUP:-"stopall"}
if [ "$ONLY" == "cleanup" ]; then
- sysctl -w lnet.debug=0 || true
+ lctl set_param debug=0 || true
$CLEANUP
exit 0
fi
test_3b() {
replay_barrier $SINGLEMDS
#define OBD_FAIL_MDS_OPEN_PACK | OBD_FAIL_ONCE
- do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000114"
+ do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000114"
touch $DIR/$tfile
- do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0"
+ do_facet $SINGLEMDS "lctl set_param fail_loc=0"
fail $SINGLEMDS
$CHECKSTAT -t file $DIR/$tfile && return 2
return 0
test_3c() {
replay_barrier $SINGLEMDS
#define OBD_FAIL_MDS_ALLOC_OBDO | OBD_FAIL_ONCE
- do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000128"
+ do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000128"
touch $DIR/$tfile
- do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0"
+ do_facet $SINGLEMDS "lctl set_param fail_loc=0"
fail $SINGLEMDS
$CHECKSTAT -t file $DIR/$tfile && return 2
touch $DIR/$tfile
#define OBD_FAIL_MDS_REINT_NET_REP 0x119
- do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000119"
+ do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000119"
rm -f $DIR/$tfile &
sleep 1
sync
sleep 1
facet_failover $SINGLEMDS
#define OBD_FAIL_MDS_CONNECT_NET 0x117
- do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000117"
+ do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000117"
kill -USR1 $PID
stat1=`count_ost_writes`
sleep $TIMEOUT
replay_barrier ost1
unlinkmany $DIR/$tfile-%d 0 400
debugsave
- sysctl -w lnet.debug=-1
+ lctl set_param debug=-1
facet_failover ost1
# osc is evicted, fs is smaller (but only with failout OSTs (bug 7287)
replay_barrier $SINGLEMDS
# OBD_FAIL_OST_CREATE_NET 0x204
- do_facet ost1 "sysctl -w lustre.fail_loc=0x80000204"
+ do_facet ost1 "lctl set_param fail_loc=0x80000204"
fail $SINGLEMDS
sleep 10
- do_facet ost1 "sysctl -w lustre.fail_loc=0"
+ do_facet ost1 "lctl set_param fail_loc=0"
return 0
}
[ "$mdcdev" ] || exit 2
for i in `seq 1 10`; do
#define OBD_FAIL_TGT_CONN_RACE 0x701
- do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000701"
+ do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000701"
$LCTL --device $mdcdev recover
df $MOUNT
done
- do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0"
+ do_facet $SINGLEMDS "lctl set_param fail_loc=0"
return 0
}
run_test 44 "race in target handle connect"
[ "$mdcdev" ] || exit 2
for i in `seq 1 10`; do
#define OBD_FAIL_TGT_DELAY_RECONNECT 0x704
- do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000704"
+ do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000704"
$LCTL --device $mdcdev recover
df $MOUNT
done
- do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0"
+ do_facet $SINGLEMDS "lctl set_param fail_loc=0"
return 0
}
run_test 44b "race in target handle connect"
# OBD_FAIL_OST_CREATE_NET 0x204
fail ost1
- do_facet ost1 "sysctl -w lustre.fail_loc=0x80000204"
+ do_facet ost1 "lctl set_param fail_loc=0x80000204"
df $MOUNT || return 2
# let the MDS discover the OST failure, attempt to recover, fail
createmany -o $DIR/$tfile 20 || return 3
unlinkmany $DIR/$tfile 20 || return 4
- do_facet ost1 "sysctl -w lustre.fail_loc=0"
+ do_facet ost1 "lctl set_param fail_loc=0"
return 0
}
run_test 47 "MDS->OSC failure during precreate cleanup (2824)"
createmany -o $DIR/$tfile 20 || return 1
# OBD_FAIL_OST_EROFS 0x216
fail $SINGLEMDS
- do_facet ost1 "sysctl -w lustre.fail_loc=0x80000216"
+ do_facet ost1 "lctl set_param fail_loc=0x80000216"
df $MOUNT || return 2
createmany -o $DIR/$tfile 20 20 || return 2
unlinkmany $DIR/$tfile 40 || return 3
- do_facet ost1 "sysctl -w lustre.fail_loc=0"
+ do_facet ost1 "lctl set_param fail_loc=0"
return 0
}
run_test 48 "MDS->OSC failure during precreate cleanup (2824)"
multiop $DIR/$tfile s || return 1
replay_barrier $SINGLEMDS
#define OBD_FAIL_LDLM_REPLY 0x30c
- do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x8000030c"
+ do_facet $SINGLEMDS "lctl set_param fail_loc=0x8000030c"
fail $SINGLEMDS || return 2
- do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x0"
+ do_facet $SINGLEMDS "lctl set_param fail_loc=0x0"
$CHECKSTAT -t file $DIR/$tfile-* && return 3 || true
}
sleep 1
#define OBD_FAIL_MDS_CLOSE_NET 0x115
- 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 # force the close
- do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0"
+ do_facet $SINGLEMDS "lctl set_param fail_loc=0"
mcreate $DIR/${tdir}-2/f || return 1
close_pid=$!
#define OBD_FAIL_MDS_REINT_NET 0x107
- 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 # force the close
wait $close_pid || return 1
close_pid=$!
#define OBD_FAIL_MDS_REINT_NET 0x107
- 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
#define OBD_FAIL_MDS_CLOSE_NET 0x115
- 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 # force the close
sleep 2
# close should be gone
[ -d /proc/$close_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
sleep 1
#define OBD_FAIL_MDS_CLOSE_NET_REP 0x13f
- do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x8000013f"
+ do_facet $SINGLEMDS "lctl set_param fail_loc=0x8000013f"
kill -USR1 $close_pid
cancel_lru_locks mdc # force the close
- do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0"
+ do_facet $SINGLEMDS "lctl set_param fail_loc=0"
mcreate $DIR/${tdir}-2/f || return 1
# close should still be here
close_pid=$!
#define OBD_FAIL_MDS_REINT_NET_REP 0x119
- do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x119"
+ do_facet $SINGLEMDS "lctl set_param fail_loc=0x119"
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 # force the close
wait $close_pid || return 1
close_pid=$!
#define OBD_FAIL_MDS_REINT_NET_REP 0x119
- do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x119"
+ do_facet $SINGLEMDS "lctl set_param fail_loc=0x119"
mcreate $DIR/${tdir}-2/f &
open_pid=$!
sleep 1
#define OBD_FAIL_MDS_CLOSE_NET_REP 0x13f
- do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x8000013f"
+ do_facet $SINGLEMDS "lctl set_param fail_loc=0x8000013f"
kill -USR1 $close_pid
cancel_lru_locks mdc # force the close
sleep 2
# close should be gone
[ -d /proc/$close_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
close_pid=$!
#define OBD_FAIL_MDS_REINT_NET_REP 0x119
- do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x119"
+ do_facet $SINGLEMDS "lctl set_param fail_loc=0x119"
mcreate $DIR/${tdir}-2/f &
open_pid=$!
sleep 1
#define OBD_FAIL_MDS_CLOSE_NET 0x115
- 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 # force the close
- do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0"
+ do_facet $SINGLEMDS "lctl set_param fail_loc=0"
replay_barrier_nodf $SINGLEMDS
fail_nodf $SINGLEMDS
wait $open_pid || return 1
close_pid=$!
#define OBD_FAIL_MDS_REINT_NET 0x107
- 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
#define OBD_FAIL_MDS_CLOSE_NET_REP 0x13f
- do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x8000013f"
+ do_facet $SINGLEMDS "lctl set_param fail_loc=0x8000013f"
kill -USR1 $close_pid
cancel_lru_locks mdc # force the close
sleep 1
sleep 2
# close should be gone
[ -d /proc/$close_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
#b3761 ASSERTION(hash != 0) failed
test_55() {
# OBD_FAIL_MDS_OPEN_CREATE | OBD_FAIL_ONCE
- do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x8000012b"
+ do_facet $SINGLEMDS "lctl set_param fail_loc=0x8000012b"
touch $DIR/$tfile &
# give touch a chance to run
sleep 5
- do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x0"
+ do_facet $SINGLEMDS "lctl set_param fail_loc=0x0"
rm $DIR/$tfile
return 0
}
#recovery one mds-ost setattr from llog
test_57() {
#define OBD_FAIL_MDS_OST_SETATTR 0x12c
- do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x8000012c"
+ do_facet $SINGLEMDS "lctl set_param fail_loc=0x8000012c"
touch $DIR/$tfile
replay_barrier $SINGLEMDS
fail $SINGLEMDS
sleep 1
$CHECKSTAT -t file $DIR/$tfile || return 1
- do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x0"
+ do_facet $SINGLEMDS "lctl set_param fail_loc=0x0"
rm $DIR/$tfile
}
run_test 57 "test recovery from llog for setattr op"
#recovery many mds-ost setattr from llog
test_58() {
#define OBD_FAIL_MDS_OST_SETATTR 0x12c
- do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x8000012c"
+ do_facet $SINGLEMDS "lctl set_param fail_loc=0x8000012c"
createmany -o $DIR/$tdir/$tfile-%d 2500
replay_barrier $SINGLEMDS
fail $SINGLEMDS
sleep 2
$CHECKSTAT -t file $DIR/$tdir/$tfile-* >/dev/null || return 1
- do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x0"
+ do_facet $SINGLEMDS "lctl set_param fail_loc=0x0"
unlinkmany $DIR/$tdir/$tfile-%d 2500
rmdir $DIR/$tdir
}
sync
unlinkmany $DIR/$tdir/$tfile-%d 200
#define OBD_FAIL_PTLRPC_DELAY_RECOV 0x507
- do_facet ost1 "sysctl -w lustre.fail_loc=0x507"
+ do_facet ost1 "lctl set_param fail_loc=0x507"
fail ost1
fail $SINGLEMDS
- do_facet ost1 "sysctl -w lustre.fail_loc=0x0"
+ do_facet ost1 "lctl set_param fail_loc=0x0"
sleep 20
rmdir $DIR/$tdir
}
#test race mds llog sync vs llog cleanup
test_61b() {
# OBD_FAIL_MDS_LLOG_SYNC_TIMEOUT 0x140
- do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000140"
+ do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000140"
facet_failover $SINGLEMDS
sleep 10
fail $SINGLEMDS
[ "$SANITYLOG" ] && rm -f $SANITYLOG || true
error() {
- sysctl -w lustre.fail_loc=0
+ lctl set_param fail_loc=0
log "FAIL: $TESTNAME $@"
$LCTL dk $TMP/lustre-log-$TESTNAME.log
if [ "$SANITYLOG" ]; then
umask 077
-OLDDEBUG="`sysctl -n lnet.debug 2> /dev/null`"
-sysctl -w lnet.debug=-1 2> /dev/null || true
+OLDDEBUG="`lctl get_param -n debug 2> /dev/null`"
+lctl set_param debug=-1 2> /dev/null || true
test_0() {
touch $DIR/$tfile
$CHECKSTAT -t file $DIR/$tfile || error
[ "$1" ] && FAIL_LOC=$1 || FAIL_LOC=0
mkdir -p $DIR/d27/nospc
rmdir $DIR/d27/nospc
- sysctl -w lustre.fail_loc=$FAIL_LOC
+ lctl set_param fail_loc=$FAIL_LOC
}
exhaust_precreations() {
mkdir -p $DIR/d27/${OST}
$SETSTRIPE $DIR/d27/${OST} -i $OSTIDX -c 1
#define OBD_FAIL_OST_ENOSPC 0x215
- sysctl -w lustre.fail_loc=0x215
+ lctl set_param fail_loc=0x215
echo "Creating to objid $last_id on ost $OST..."
createmany -o $DIR/d27/${OST}/f $next_id $((last_id - next_id + 2))
lctl get_param -n osc.*${OST}-osc-MDT0000.prealloc* | grep '[0-9]'
#define OBD_FAIL_MDS_OSC_PRECREATE 0x13d
- sysctl -w lustre.fail_loc=0x13d
+ lctl set_param fail_loc=0x13d
mkdir -p $DIR/d27u
createmany -o $DIR/d27u/t- 1000
- sysctl -w lustre.fail_loc=0
+ lctl set_param fail_loc=0
TLOG=$DIR/$tfile.getstripe
$GETSTRIPE $DIR/d27u > $TLOG
touch $DIR/$tdir/$tfile
#define OBD_FAIL_TGT_DELAY_PRECREATE 0x705
- sysctl -w lustre.fail_loc=0x705
+ lctl set_param fail_loc=0x705
START=`date +%s`
for F in `seq 1 32`; do
touch $DIR/$tdir/$tfile.$F
done
- sysctl -w lustre.fail_loc=0
+ lctl set_param fail_loc=0
FINISH=`date +%s`
- TIMEOUT=`sysctl -n lustre.timeout`
+ TIMEOUT=`lctl get_param -n timeout`
[ $((FINISH - START)) -ge $((TIMEOUT / 2)) ] && \
error "$FINISH - $START >= $TIMEOUT / 2"
DATESTR="Dec 20 2000"
mkdir -p $DIR/$tdir
#define OBD_FAIL_OST_BRW_PAUSE_BULK 0x214
- sysctl -w lustre.fail_loc=0x80000214
+ lctl set_param fail_loc=0x80000214
date; date +%s
cp /etc/hosts $DIR/$tdir/$tfile
sync & # write RPC generated with "current" inode timestamp, but delayed
test_48c() { # bug 2350
check_kernel_version 36 || return 0
- #sysctl -w lnet.debug=-1
+ #lctl set_param debug=-1
#set -vx
mkdir -p $DIR/d48c/dir
cd $DIR/d48c/dir
test_48d() { # bug 2350
check_kernel_version 36 || return 0
- #sysctl -w lnet.debug=-1
+ #lctl set_param debug=-1
#set -vx
mkdir -p $DIR/d48d/dir
cd $DIR/d48d/dir
test_48e() { # bug 4134
check_kernel_version 41 || return 0
- #sysctl -w lnet.debug=-1
+ #lctl set_param debug=-1
#set -vx
mkdir -p $DIR/d48e/dir
cd $DIR/d48e/dir
echo "create 5000 files"
createmany -o $DIR/f60c- 5000
#define OBD_FAIL_MDS_LLOG_CREATE_FAILED 0x13c
- sysctl -w lustre.fail_loc=0x8000013c
+ lctl set_param fail_loc=0x8000013c
unlinkmany $DIR/f60c- 5000
- sysctl -w lustre.fail_loc=0
+ lctl set_param fail_loc=0
}
run_test 60c "unlink file when mds full"
$LCTL mark "$MESSAGE" || error "$LCTL mark failed"
dmesg | grep -q "$MESSAGE" || error "didn't find debug marker in log"
- lctl set_param -n printk=0 || error "set lnet.printk failed"
+ lctl set_param printk=0 || error "set lnet.printk failed"
lctl get_param -n printk | grep emerg || error "lnet.printk dropped emerg"
MESSAGE="new test message ID $RANDOM $$"
# Assume here that libcfs_debug_mark_buffer() uses D_WARNING
$LCTL mark "$MESSAGE" || error "$LCTL mark failed"
dmesg | grep -q "$MESSAGE" && error "D_WARNING wasn't masked" || true
- sysctl -w lnet.printk="$SAVEPRINTK"
+ lctl set_param -n printk="$SAVEPRINTK"
}
run_test 60d "test printk console message masking"
f="$DIR/f62"
echo foo > $f
cancel_lru_locks osc
- sysctl -w lustre.fail_loc=0x405
+ lctl set_param fail_loc=0x405
cat $f && error "cat succeeded, expect -EIO"
- sysctl -w lustre.fail_loc=0
+ lctl set_param fail_loc=0
}
run_test 62 "verify obd_match failure doesn't LBUG (should -EIO)"
# bug 3677 - async write errors left page locked
test_63b() {
debugsave
- sysctl -w lnet.debug=-1
+ lctl set_param debug=-1
# ensure we have a grant to do async writes
dd if=/dev/zero of=$DIR/$tfile bs=4k count=1
rm $DIR/$tfile
#define OBD_FAIL_OSC_BRW_PREP_REQ 0x406
- sysctl -w lustre.fail_loc=0x80000406
+ lctl set_param fail_loc=0x80000406
multiop $DIR/$tfile Owy && \
error "sync didn't return ENOMEM"
sync; sleep 2; sync # do a real sync this time to flush page
$DIRECTIO write ${f}.2 0 1 || error "directio write error"
- sysctl -w lustre.fail_loc=0x217
+ lctl set_param fail_loc=0x217
truncate $f 1 # vmtruncate() will ignore truncate() error.
$DIRECTIO write $f 0 2 && error "write succeeded, expect -ENOENT"
- sysctl -w lustre.fail_loc=0
+ lctl set_param fail_loc=0
$DIRECTIO write $f 0 2 || error "write error"
cancel_lru_locks osc
$DIRECTIO read $f 0 1 || error "read error"
- sysctl -w lustre.fail_loc=0x217
+ lctl set_param fail_loc=0x217
$DIRECTIO read $f 1 1 && error "read succeeded, expect -ENOENT"
- sysctl -w lustre.fail_loc=0
+ lctl set_param fail_loc=0
rm -f $f
}
run_test 69 "verify oa2dentry return -ENOENT doesn't LBUG ======"
multiop_bg_pause $DIR/d73-1/f73-1 O_c || return 1
pid1=$!
- lctl set_param -n fail_loc=0x80000129
+ lctl set_param fail_loc=0x80000129
multiop $DIR/d73-1/f73-2 Oc &
sleep 1
- lctl set_param -n fail_loc=0
+ lctl set_param fail_loc=0
multiop $DIR/d73-2/f73-3 Oc &
pid3=$!
# very important to OR with OBD_FAIL_ONCE (0x80000000) -- otherwise it
# will spin in a tight reconnection loop
touch $DIR/f74a
- sysctl -w lustre.fail_loc=0x8000030e
+ lctl set_param fail_loc=0x8000030e
# get any lock that won't be difficult - lookup works.
ls $DIR/f74a
- sysctl -w lustre.fail_loc=0
+ lctl set_param fail_loc=0
true
}
run_test 74a "ldlm_enqueue freed-export error path, ls (shouldn't LBUG)"
#
# very important to OR with OBD_FAIL_ONCE (0x80000000) -- otherwise it
# will spin in a tight reconnection loop
- sysctl -w lustre.fail_loc=0x8000030e
+ lctl set_param fail_loc=0x8000030e
# get a "difficult" lock
touch $DIR/f74b
- sysctl -w lustre.fail_loc=0
+ lctl set_param fail_loc=0
true
}
run_test 74b "ldlm_enqueue freed-export error path, touch (shouldn't LBUG)"
test_77b() { # bug 10889
[ ! -f $F77_TMP ] && setup_f77
#define OBD_FAIL_OSC_CHECKSUM_SEND 0x409
- sysctl -w lustre.fail_loc=0x80000409
+ lctl set_param fail_loc=0x80000409
set_checksums 1
dd if=$F77_TMP of=$DIR/f77b bs=1M count=$F77SZ conv=sync || \
error "dd error: $?"
- sysctl -w lustre.fail_loc=0
+ lctl set_param fail_loc=0
set_checksums 0
}
run_test 77b "checksum error on client write ===================="
cancel_lru_locks osc
set_checksum_type $algo
#define OBD_FAIL_OSC_CHECKSUM_RECEIVE 0x408
- sysctl -w lustre.fail_loc=0x80000408
+ lctl set_param fail_loc=0x80000408
cmp $F77_TMP $DIR/f77b || error "file compare failed"
- sysctl -w lustre.fail_loc=0
+ lctl set_param fail_loc=0
done
set_checksums 0
set_checksum_type $ORIG_CSUM_TYPE
test_77d() { # bug 10889
#define OBD_FAIL_OSC_CHECKSUM_SEND 0x409
- sysctl -w lustre.fail_loc=0x80000409
+ lctl set_param fail_loc=0x80000409
set_checksums 1
directio write $DIR/f77 0 $F77SZ $((1024 * 1024)) || \
error "direct write: rc=$?"
- sysctl -w lustre.fail_loc=0
+ lctl set_param fail_loc=0
set_checksums 0
}
run_test 77d "checksum error on OST direct write ==============="
test_77e() { # bug 10889
[ ! -f $DIR/f77 ] && skip "requires 77d - skipping" && return
#define OBD_FAIL_OSC_CHECKSUM_RECEIVE 0x408
- sysctl -w lustre.fail_loc=0x80000408
+ lctl set_param fail_loc=0x80000408
set_checksums 1
cancel_lru_locks osc
directio read $DIR/f77 0 $F77SZ $((1024 * 1024)) || \
error "direct read: rc=$?"
- sysctl -w lustre.fail_loc=0
+ lctl set_param fail_loc=0
set_checksums 0
}
run_test 77e "checksum error on OST direct read ================"
cancel_lru_locks osc
set_checksum_type $algo
#define OBD_FAIL_OSC_CHECKSUM_SEND 0x409
- sysctl -w lustre.fail_loc=0x409
+ lctl set_param fail_loc=0x409
directio write $DIR/f77 0 $F77SZ $((1024 * 1024)) && \
error "direct write succeeded"
- sysctl -w lustre.fail_loc=0
+ lctl set_param fail_loc=0
done
set_checksum_type $ORIG_CSUM_TYPE
set_checksums 0
skip "remote OST" && return
[ ! -f $F77_TMP ] && setup_f77
#define OBD_FAIL_OST_CHECKSUM_RECEIVE 0x21a
- sysctl -w lustre.fail_loc=0x8000021a
+ lctl set_param fail_loc=0x8000021a
set_checksums 1
dd if=$F77_TMP of=$DIR/f77 bs=1M count=$F77SZ || \
error "write error: rc=$?"
- sysctl -w lustre.fail_loc=0
+ lctl set_param fail_loc=0
set_checksums 0
}
run_test 77g "checksum error on OST write ======================"
[ ! -f $DIR/f77 ] && skip "requires 77g - skipping" && return
cancel_lru_locks osc
#define OBD_FAIL_OST_CHECKSUM_SEND 0x21b
- sysctl -w lustre.fail_loc=0x8000021b
+ lctl set_param fail_loc=0x8000021b
set_checksums 1
cmp $F77_TMP $DIR/f77 || error "file compare failed"
- sysctl -w lustre.fail_loc=0
+ lctl set_param fail_loc=0
set_checksums 0
}
run_test 77h "checksum error on OST read ======================="
test_77i() { # bug 13805
#define OBD_FAIL_OSC_CONNECT_CKSUM 0x40b
- sysctl -w lustre.fail_loc=0x40b
+ lctl set_param fail_loc=0x40b
remount_client $MOUNT
- sysctl -w lustre.fail_loc=0
+ lctl set_param fail_loc=0
for VALUE in `lctl get_param osc.*osc-[^mM]*.checksum_type`; do
PARAM=`echo ${VALUE[0]} | cut -d "=" -f1`
algo=`lctl get_param -n $PARAM | sed 's/.*\[\(.*\)\].*/\1/g'`
test_77j() { # bug 13805
#define OBD_FAIL_OSC_CKSUM_ADLER_ONLY 0x40c
- sysctl -w lustre.fail_loc=0x40c
+ lctl set_param fail_loc=0x40c
remount_client $MOUNT
- sysctl -w lustre.fail_loc=0
+ lctl set_param fail_loc=0
for VALUE in `lctl get_param osc.*osc-[^mM]*.checksum_type`; do
PARAM=`echo ${VALUE[0]} | cut -d "=" -f1`
algo=`lctl get_param -n $PARAM | sed 's/.*\[\(.*\)\].*/\1/g'`
{
dd if=/dev/zero of=$DIR/$tfile bs=1M count=1
#define OBD_FAIL_OST_SETATTR_CREDITS 0x21e
- sysctl -w lustre.fail_loc=0x21e
+ lctl set_param fail_loc=0x21e
> $DIR/$tfile || error "truncate failed"
- sysctl -w lustre.fail_loc=0
+ lctl set_param fail_loc=0
echo "Truncate succeeded."
}
run_test 117 "verify fsfilt_extend =========="
reset_async
#define OBD_FAIL_OSC_BRW_PREP_REQ2 0x40a
- sysctl -w lustre.fail_loc=0x8000040a
+ lctl set_param fail_loc=0x8000040a
# Should simulate EINVAL error which is fatal
multiop $DIR/$tfile oO_CREAT:O_RDWR:O_SYNC:w4096c
error "Must return error due to dropped pages, rc=$RC"
fi
- sysctl -w lustre.fail_loc=0x0
+ lctl set_param fail_loc=0x0
LOCKED=$(lctl get_param -n llite.*.dump_page_cache | grep -c locked)
DIRTY=$(lctl get_param -n llite.*.dump_page_cache | grep -c dirty)
run_test 118f "Simulate unrecoverable OSC side error =========="
test_118g() {
- reset_async
+ reset_async
#define OBD_FAIL_OSC_BRW_PREP_REQ 0x406
- sysctl -w lustre.fail_loc=0x406
+ lctl set_param fail_loc=0x406
# simulate local -ENOMEM
- multiop $DIR/$tfile oO_CREAT:O_RDWR:O_SYNC:w4096c
- RC=$?
+ multiop $DIR/$tfile oO_CREAT:O_RDWR:O_SYNC:w4096c
+ RC=$?
- sysctl -w lustre.fail_loc=0
+ lctl set_param fail_loc=0
if [[ $RC -eq 0 ]]; then
error "Must return error due to dropped pages, rc=$RC"
fi
- LOCKED=$(lctl get_param -n llite.*.dump_page_cache | grep -c locked)
- DIRTY=$(lctl get_param -n llite.*.dump_page_cache | grep -c dirty)
- WRITEBACK=$(lctl get_param -n llite.*.dump_page_cache |
- grep -c writeback)
+ LOCKED=$(lctl get_param -n llite.*.dump_page_cache | grep -c locked)
+ DIRTY=$(lctl get_param -n llite.*.dump_page_cache | grep -c dirty)
+ WRITEBACK=$(lctl get_param -n llite.*.dump_page_cache |
+ grep -c writeback)
if [[ $LOCKED -ne 0 ]]; then
error "Locked pages remain in cache, locked=$LOCKED"
fi
rm -f $DIR/$tfile
echo "No pages locked after fsync"
- reset_async
+ reset_async
return 0
}
run_test 118g "Don't stay in wait if we got local -ENOMEM =========="
rm -rf $DIR/$tfile
writes=$(LANG=C dd if=/dev/zero of=$DIR/$tfile count=1 2>&1 | awk -F '+' '/out/ {print $1}')
#define OBD_FAIL_LDLM_CANCEL_RACE 0x310
- sysctl -w lustre.fail_loc=0x310
+ lctl set_param fail_loc=0x310
cancel_lru_locks osc > /dev/null
reads=$(LANG=C dd if=$DIR/$tfile of=/dev/null 2>&1 | awk -F '+' '/in/ {print $1}')
- sysctl -w lustre.fail_loc=0
+ lctl set_param fail_loc=0
[ "$reads" -eq "$writes" ] || error "read" $reads "blocks, must be" $writes
}
run_test 121 "read cancel race ========="
cancel_lru_locks osc
#define OBD_FAIL_MDC_GETATTR_ENQUEUE 0x803
- sysctl -w lustre.fail_loc=0x80000803
+ lctl set_param fail_loc=0x80000803
ls -lR $DIR/$tdir > /dev/null
log "ls done"
- sysctl -w lustre.fail_loc=0x0
+ lctl set_param fail_loc=0x0
lctl get_param -n llite.*.statahead_stats
rm -r $DIR/$tdir
sync
log "cleanup: ======================================================"
check_and_cleanup_lustre
if [ "$I_MOUNTED" != "yes" ]; then
- sysctl -w lnet.debug="$OLDDEBUG" 2> /dev/null || true
+ lctl set_param debug="$OLDDEBUG" 2> /dev/null || true
fi
echo '=========================== finished ==============================='
cp /etc/termcap $DIR1/f17
cancel_lru_locks osc > /dev/null
#define OBD_FAIL_ONCE|OBD_FAIL_LDLM_CREATE_RESOURCE 0x30a
- sysctl -w lustre.fail_loc=0x8000030a
+ lctl set_param fail_loc=0x8000030a
ls -ls $DIR1/f17 | awk '{ print $1,$6 }' > $DIR1/f17-1 & \
ls -ls $DIR2/f17 | awk '{ print $1,$6 }' > $DIR2/f17-2
wait
test_29() { # bug 10999
touch $DIR1/$tfile
#define OBD_FAIL_LDLM_GLIMPSE 0x30f
- sysctl -w lustre.fail_loc=0x8000030f
+ lctl set_param fail_loc=0x8000030f
ls -l $DIR2/$tfile &
usleep 500
dd if=/dev/zero of=$DIR1/$tfile bs=4k count=1
writes=`LANG=C dd if=/dev/zero of=$DIR/$tdir/$tfile count=1 2>&1 |
awk 'BEGIN { FS="+" } /out/ {print $1}'`
#define OBD_FAIL_LDLM_CANCEL_BL_CB_RACE 0x314
- sysctl -w lustre.fail_loc=0x314
+ lctl set_param fail_loc=0x314
reads=`LANG=C dd if=$DIR2/$tdir/$tfile of=/dev/null 2>&1 |
awk 'BEGIN { FS="+" } /in/ {print $1}'`
[ $reads -eq $writes ] || error "read" $reads "blocks, must be" $writes
echo Loading modules from $LUSTRE
load_module ../lnet/libcfs/libcfs
- [ "$PTLDEBUG" ] && sysctl -w lnet.debug=$PTLDEBUG
- [ "$SUBSYSTEM" ] && sysctl -w lnet.subsystem_debug=${SUBSYSTEM# }
+ [ "$PTLDEBUG" ] && lctl set_param debug=$PTLDEBUG
+ [ "$SUBSYSTEM" ] && lctl set_param subsystem_debug=${SUBSYSTEM# }
[ -f /etc/modprobe.conf ] && MODPROBECONF=/etc/modprobe.conf
[ -f /etc/modprobe.d/Lustre ] && MODPROBECONF=/etc/modprobe.d/Lustre
[ -z "$LNETOPTS" -a -n "$MODPROBECONF" ] && \
echo "mount -t lustre $@ ${device} ${MOUNT%/*}/${facet}"
echo "Start of ${device} on ${facet} failed ${RC}"
else
- do_facet ${facet} "sysctl -w lnet.debug=$PTLDEBUG; \
- sysctl -w lnet.subsystem_debug=${SUBSYSTEM# }; \
- sysctl -w lnet.debug_mb=${DEBUG_SIZE}; \
+ do_facet ${facet} "lctl set_param debug=$PTLDEBUG; \
+ lctl set_param subsystem_debug=${SUBSYSTEM# }; \
+ lctl set_param debug_mb=${DEBUG_SIZE}; \
sync"
fi
return $RC
do_node $client mkdir -p $mnt
do_node $client mount -t lustre $OPTIONS $device $mnt || return 1
- do_node $client "sysctl -w lnet.debug=$PTLDEBUG;
- sysctl -w lnet.subsystem_debug=${SUBSYSTEM# };
- sysctl -w lnet.debug_mb=${DEBUG_SIZE}"
+ do_node $client "lctl set_param debug=$PTLDEBUG;
+ lctl set_param subsystem_debug=${SUBSYSTEM# };
+ lctl set_param debug_mb=${DEBUG_SIZE}"
[ -d /r ] && $LCTL modules > /r/tmp/ogdb-$HOSTNAME
return 0
}
}
wait_mds_recovery_done () {
- local timeout=`do_facet mds sysctl -n lustre.timeout`
+ local timeout=`do_facet mds lctl get_param -n timeout`
#define OBD_RECOVERY_TIMEOUT (obd_timeout * 5 / 2)
# as we are in process of changing obd_timeout in different ways
# let's set MAX longer than that
do_facet $facet lsmod | grep -q obdclass || \
do_facet $facet "modprobe obdclass"
- do_facet $facet "sysctl -w lustre.timeout=$timeout"
+ do_facet $facet "lctl set_param timeout=$timeout"
}
setupall() {
cleanup_and_setup_lustre() {
if [ "$ONLY" == "cleanup" -o "`mount | grep $MOUNT`" ]; then
- sysctl -w lnet.debug=0 || true
+ lctl set_param debug=0 || true
cleanupall
if [ "$ONLY" == "cleanup" ]; then
exit 0
drop_request() {
# OBD_FAIL_MDS_ALL_REQUEST_NET
RC=0
- do_facet mds sysctl -w lustre.fail_loc=0x123
+ do_facet mds lctl set_param fail_loc=0x123
do_facet client "$1" || RC=$?
- do_facet mds sysctl -w lustre.fail_loc=0
+ do_facet mds lctl set_param fail_loc=0
return $RC
}
drop_reply() {
# OBD_FAIL_MDS_ALL_REPLY_NET
RC=0
- do_facet mds sysctl -w lustre.fail_loc=0x122
+ do_facet mds lctl set_param fail_loc=0x122
do_facet client "$@" || RC=$?
- do_facet mds sysctl -w lustre.fail_loc=0
+ do_facet mds lctl set_param fail_loc=0
return $RC
}
drop_reint_reply() {
# OBD_FAIL_MDS_REINT_NET_REP
RC=0
- do_facet mds sysctl -w lustre.fail_loc=0x119
+ do_facet mds lctl set_param fail_loc=0x119
do_facet client "$@" || RC=$?
- do_facet mds sysctl -w lustre.fail_loc=0
+ do_facet mds lctl set_param fail_loc=0
return $RC
}
pause_bulk() {
#define OBD_FAIL_OST_BRW_PAUSE_BULK 0x214
RC=0
- do_facet ost1 sysctl -w lustre.fail_loc=0x214
+ do_facet ost1 lctl set_param fail_loc=0x214
do_facet client "$1" || RC=$?
do_facet client "sync"
- do_facet ost1 sysctl -w lustre.fail_loc=0
+ do_facet ost1 lctl set_param fail_loc=0
return $RC
}
drop_ldlm_cancel() {
#define OBD_FAIL_LDLM_CANCEL 0x304
RC=0
- do_facet client sysctl -w lustre.fail_loc=0x304
+ do_facet client lctl set_param fail_loc=0x304
do_facet client "$@" || RC=$?
- do_facet client sysctl -w lustre.fail_loc=0
+ do_facet client lctl set_param fail_loc=0
return $RC
}
drop_bl_callback() {
#define OBD_FAIL_LDLM_BL_CALLBACK 0x305
RC=0
- do_facet client sysctl -w lustre.fail_loc=0x305
+ do_facet client lctl set_param fail_loc=0x305
do_facet client "$@" || RC=$?
- do_facet client sysctl -w lustre.fail_loc=0
+ do_facet client lctl set_param fail_loc=0
return $RC
}
drop_ldlm_reply() {
#define OBD_FAIL_LDLM_REPLY 0x30c
RC=0
- do_facet mds sysctl -w lustre.fail_loc=0x30c
+ do_facet mds lctl set_param fail_loc=0x30c
do_facet client "$@" || RC=$?
- do_facet mds sysctl -w lustre.fail_loc=0
+ do_facet mds lctl set_param fail_loc=0
return $RC
}
pause=$2
sleep $pause
echo "clearing fail_loc on $facet"
- do_facet $facet "sysctl -e -w lustre.fail_loc=0"
+ do_facet $facet "lctl set_param fail_loc=0 2>/dev/null || true"
}
set_nodes_failloc () {
local node
for node in $nodes ; do
- do_node $node sysctl -w lustre.fail_loc=$2
+ do_node $node lctl set_param fail_loc=$2
done
}
}
debugsave() {
- DEBUGSAVE="$(sysctl -n lnet.debug)"
+ DEBUGSAVE="$(lctl get_param -n debug)"
}
debugrestore() {
- [ -n "$DEBUGSAVE" ] && sysctl -w lnet.debug="${DEBUGSAVE}"
+ [ -n "$DEBUGSAVE" ] && lctl set_param debug="${DEBUGSAVE}"
DEBUGSAVE=""
}
error_noexit() {
local TYPE=${TYPE:-"FAIL"}
local ERRLOG
- sysctl -e -w lustre.fail_loc=0 || true
+ lctl set_param fail_loc=0 2>/dev/null || true
log " ${TESTSUITE} ${TESTNAME}: @@@@@@ ${TYPE}: $@ "
ERRLOG=$TMP/lustre_${TESTSUITE}_${TESTNAME}.$(date +%s)
echo "Dumping lctl log to $ERRLOG"
local NODE
for NODE in $myNODES; do
- do_node $NODE sysctl -e -w lustre.fail_loc=0 || true
+ do_node $NODE "lctl set_param fail_loc=0 2>/dev/null || true"
done
}