# record size (KBytes) ( 7168 max)
rszlo=${rszlo:-1024}
rszhi=${rszhi:-1024}
+rszmax=${rszmax:-1024} # the maximum bulk I/O RPC size
# number of objects per OST
nobjlo=${nobjlo:-1}
echo $minusn "$*"
}
+version_code() {
+ # split arguments like "2.1.5" into "2", "1", "5"
+ eval set -- $(tr "[:punct:]" " " <<< $*)
+ echo -n "$((($1 << 16) | ($2 << 8) | $3))"
+}
+
+get_lustre_version() {
+ local host=${1:-${unique_hosts[0]}}
+ remote_shell $host $lctl get_param -n version |
+ awk '/^lustre:/ {print $2}'
+}
+
+# Check whether the record size (KBytes) exceeds the maximum bulk I/O RPC size
+# or not.
+check_record_size() {
+ [ $(version_code $(get_lustre_version)) -ge $(version_code 2.3.61) ] &&
+ rszmax=4096
+
+ if [ "$rszhi" -gt "$rszmax" ]; then
+ echo "Test disk case support maximum ${rszmax}KB IO data" \
+ "(rszhi=$rszhi is too big), please use a smaller value."
+ return 1
+ fi
+ return 0
+}
+
# Customisation variables
#####################################################################
# One can change variable values in this section as per requirements
# disable portals debug and get obdecho loaded on all relevant hosts
unique_hosts=(`unique ${host_names[@]}`)
load_obdechos
+
+if [ $case == "disk" ]; then
+ check_record_size || cleanup ${PIPESTATUS[0]}
+fi
+
pidcount=0
for host in ${unique_hosts[@]}; do
host_vmstatf=${vmstatf}_${host}
run_test 180b "test obdecho directly on obdfilter"
test_180c() { # LU-2598
+ local server_version=$(lustre_version_code $SINGLEMDS)
+
+ [[ $server_version -lt $(version_code 2.1.5) ]] &&
+ skip "Need MDS version at least 2.1.5" && return
+
+ # Patch not applied to 2.2 and 2.3 branches
+ [[ $server_version -ge $(version_code 2.2.0) ]] &&
+ [[ $server_version -lt $(version_code 2.4.0) ]] &&
+ skip "Need MDS version at least 2.4.0" && return
+
local rc=0
local rmmod_remote=false
local pages=8192 # 32MB bulk I/O RPC size
target=$(do_facet ost1 $LCTL dl | awk '/obdfilter/ {print $4}'|head -1)
if [[ -n $target ]]; then
obdecho_create_test "$target" ost1 "$pages"
- if [[ ${PIPESTATUS[0]} != 4 ]]; then
- echo "obecho_create_test should fail with rc=4"
- rc=1
+ rc=${PIPESTATUS[0]}
+ if [[ $server_version -ge $(version_code 2.1.5) ]] &&
+ [[ $server_version -lt $(version_code 2.2.0) ]]; then
+ if [[ $rc -ne 4 ]]; then
+ echo "obecho_create_test should fail with rc=4"
+ rc=1
+ else
+ rc=0
+ fi
fi
else
echo "there is no obdfilter target on ost1"