test_85a() { #bug 16774
lctl set_param -n ldlm.cancel_unused_locks_before_replay "1"
- for i in `seq 100`; do
- echo "tag-$i" > $DIR/$tfile-$i
- grep -q "tag-$i" $DIR/$tfile-$i || error "f2-$i"
- done
+ createmany -o $DIR/$tfile- 100
+ ls -l $DIR/ > /dev/null
lov_id=`lctl dl | grep "clilov"`
addr=`echo $lov_id | awk '{print $4}' | awk -F '-' '{print $3}'`
count=`lctl get_param -n ldlm.namespaces.*MDT0000*$addr.lock_unused_count`
echo "before recovery: unused locks count = $count"
+ [ $count -ne 0 ] || error "unused locks should not be zero before recovery"
fail mds
count2=`lctl get_param -n ldlm.namespaces.*MDT0000*$addr.lock_unused_count`
echo "after recovery: unused locks count = $count2"
- if [ $count2 -ge $count ]; then
- error "unused locks are not canceled"
- fi
+ [ $count2 -lt $count ] || error "unused locks are not canceled"
}
run_test 85a "check the cancellation of unused locks during recovery(IBITS)"