local group=${lmm[$((j+3))]}
local dev=$(ostdevname $devnum)
local dir=${MOUNT%/*}/ost$devnum
+ local mntpt=$(facet_mntpt ost$devnum)
stop ost$devnum
do_facet ost$devnum mount -t $FSTYPE $dev $dir $OST_MOUNT_OPTS ||
[ $stripe -eq $i ] || { error "stripe mismatch"; return 6; }
echo -e "\t\tost $obdidx, objid $objid, group $group"
- do_facet ost$devnum umount -d $dev
+ do_facet ost$devnum umount -d $mntpt
start ost$devnum $dev $OST_MOUNT_OPTS
done
}
test_36g() {
remote_ost_nodsh && skip "remote OST with nodsh" && return
+ local fmd_max_age
+ local fmd_before
+ local fmd_after
mkdir -p $DIR/$tdir
- export FMD_MAX_AGE=`do_facet ost1 lctl get_param -n obdfilter.*.client_cache_seconds 2> /dev/null | head -n 1`
- FMD_BEFORE="`awk '/ll_fmd_cache/ { print $2 }' /proc/slabinfo`"
+ fmd_max_age=$(do_facet ost1 \
+ "lctl get_param -n obdfilter.*.client_cache_seconds 2> /dev/null | \
+ head -n 1")
+
+ fmd_before=$(do_facet ost1 \
+ "awk '/ll_fmd_cache/ {print \\\$2}' /proc/slabinfo")
touch $DIR/$tdir/$tfile
- sleep $((FMD_MAX_AGE + 12))
- FMD_AFTER="`awk '/ll_fmd_cache/ { print $2 }' /proc/slabinfo`"
- [ "$FMD_AFTER" -gt "$FMD_BEFORE" ] && \
- echo "AFTER : $FMD_AFTER > BEFORE $FMD_BEFORE" && \
+ sleep $((fmd_max_age + 12))
+ fmd_after=$(do_facet ost1 \
+ "awk '/ll_fmd_cache/ {print \\\$2}' /proc/slabinfo")
+
+ echo "fmd_before: $fmd_before"
+ echo "fmd_after: $fmd_after"
+ [ "$fmd_after" -gt "$fmd_before" ] && \
+ echo "AFTER: $fmd_after > BEFORE: $fmd_before" && \
error "fmd didn't expire after ping" || true
}
run_test 36g "filter mod data cache expiry ====================="
}
run_test 154 "Opening a file by FID"
-test_155_load() {
+test_155_small_load() {
local temp=$TMP/$tfile
local file=$DIR/$tfile
- local list=$(comma_list $(osts_nodes))
- local big=$(do_nodes $list grep "cache" /proc/cpuinfo | \
- awk '{sum+=$4} END{print sum}')
-
- log big is $big K
dd if=/dev/urandom of=$temp bs=6096 count=1 || \
error "dd of=$temp bs=6096 count=1 failed"
echo "12345" >>$file
cmp $temp $file || error "$temp $file differ (append2)"
- dd if=/dev/urandom of=$temp bs=$((big*2)) count=1k || \
- error "dd of=$temp bs=$((big*2)) count=1k failed"
+ rm -f $temp $file
+ true
+}
+
+test_155_big_load() {
+ local temp=$TMP/$tfile
+ local file=$DIR/$tfile
+
+ free_min_max
+ local cache_size=$(do_facet ost$((MAXI+1)) \
+ "awk '/cache/ {sum+=\\\$4} END {print sum}' /proc/cpuinfo")
+ local large_file_size=$((cache_size * 2))
+
+ echo "OSS cache size: $cache_size KB"
+ echo "Large file size: $large_file_size KB"
+
+ [ $MAXV -le $large_file_size ] && \
+ skip_env "max available OST size needs > $large_file_size KB" && \
+ return 0
+
+ $SETSTRIPE $file -c 1 -i $MAXI || error "$SETSTRIPE $file failed"
+
+ dd if=/dev/urandom of=$temp bs=$large_file_size count=1k || \
+ error "dd of=$temp bs=$large_file_size count=1k failed"
cp $temp $file
ls -lh $temp $file
cancel_lru_locks osc
cmp $temp $file || error "$temp $file differ"
- rm -f $temp
+ rm -f $temp $file
true
}
test_155a() {
set_cache read on
set_cache writethrough on
- test_155_load
+ test_155_small_load
}
-run_test 155a "Verification of correctness: read cache:on write_cache:on"
+run_test 155a "Verify small file correctness: read cache:on write_cache:on"
test_155b() {
set_cache read on
set_cache writethrough off
- test_155_load
+ test_155_small_load
}
-run_test 155b "Verification of correctness: read cache:on write_cache:off"
+run_test 155b "Verify small file correctness: read cache:on write_cache:off"
test_155c() {
set_cache read off
set_cache writethrough on
- test_155_load
+ test_155_small_load
}
-run_test 155c "Verification of correctness: read cache:off write_cache:on"
+run_test 155c "Verify small file correctness: read cache:off write_cache:on"
test_155d() {
set_cache read off
set_cache writethrough off
- test_155_load
+ test_155_small_load
+}
+run_test 155d "Verify small file correctness: read cache:off write_cache:off"
+
+test_155e() {
+ set_cache read on
+ set_cache writethrough on
+ test_155_big_load
+}
+run_test 155e "Verify big file correctness: read cache:on write_cache:on"
+
+test_155f() {
+ set_cache read on
+ set_cache writethrough off
+ test_155_big_load
+}
+run_test 155f "Verify big file correctness: read cache:on write_cache:off"
+
+test_155g() {
+ set_cache read off
+ set_cache writethrough on
+ test_155_big_load
+}
+run_test 155g "Verify big file correctness: read cache:off write_cache:on"
+
+test_155h() {
+ set_cache read off
+ set_cache writethrough off
+ test_155_big_load
}
-run_test 155d "Verification of correctness: read cache:off write_cache:off "
+run_test 155h "Verify big file correctness: read cache:off write_cache:off"
test_156() {
local CPAGES=3
local expected_good=$((good_line1 + good_line2*2))
rm -f $TMP/${tfile}*
- if [ $bad_line -ne $bad_line_new ]; then
+ # LU-231, short malformed line may not be counted into bad lines
+ if [ $bad_line -ne $bad_line_new ] &&
+ [ $bad_line -ne $((bad_line_new - 1)) ]; then
error "expected $bad_line bad lines, but got $bad_line_new"
return 1
fi
#define OBD_FAIL_PTLRPC_DUMP_LOG 0x50e
$LCTL set_param fail_loc=0x50e
$LCTL set_param fail_val=3000
- multiop_bg_pause $DIR/$tfile Os || true
+ multiop_bg_pause $DIR/$tfile O_s || true
+ local MULTIPID=$!
+ kill -USR1 $MULTIPID
# cause log dump
sleep 3
+ wait $MULTIPID
if dmesg | grep "recursive fault"; then
error "caught a recursive fault"
fi
local ost_nid=$1
local obdfilter_name=$2
echo "Creating new osc for $obdfilter_name on $ost_nid"
+ # make sure we can find loopback nid
+ $LCTL add_uuid $ost_nid $ost_nid >/dev/null 2>&1
+
[ $rc -eq 0 ] && { $LCTL attach osc ${obdfilter_name}_osc \
${obdfilter_name}_osc_UUID || rc=2; }
[ $rc -eq 0 ] && { $LCTL --device ${obdfilter_name}_osc setup \
}
run_test 180b "test obdecho directly on obdfilter"
+test_181() { # bug 22177
+ mkdir -p $DIR/$tdir || error "creating dir $DIR/$tdir"
+ # create enough files to index the directory
+ createmany -o $DIR/$tdir/foobar 4000
+ # print attributes for debug purpose
+ lsattr -d .
+ # open dir
+ multiop_bg_pause $DIR/$tdir D_Sc || return 1
+ MULTIPID=$!
+ # remove the files & current working dir
+ unlinkmany $DIR/$tdir/foobar 4000
+ rmdir $DIR/$tdir
+ kill -USR1 $MULTIPID
+ wait $MULTIPID
+ stat $DIR/$tdir && error "open-unlinked dir was not removed!"
+ return 0
+}
+run_test 181 "Test open-unlinked dir ========================"
+
# OST pools tests
POOL=${POOL:-cea1}
TGT_COUNT=$OSTCOUNT