+
+#b=2494
+test_12(){
+ $LCTL mark multiop $MOUNT/$tfile OS_c
+ do_facet mds "sysctl -w lustre.fail_loc=0x115"
+ clear_failloc mds $((TIMEOUT * 2)) &
+ multiop $MOUNT/$tfile OS_c &
+ PID=$!
+#define OBD_FAIL_MDS_CLOSE_NET 0x115
+ sleep 2
+ kill -USR1 $PID
+ echo "waiting for multiop $PID"
+ wait $PID || return 2
+ do_facet client munlink $MOUNT/$tfile || return 3
+}
+run_test 12 "recover from timed out resend in ptlrpcd (b=2494)"
+
+# Bug 113, check that readdir lost recv timeout works.
+test_13() {
+ mkdir /mnt/lustre/readdir
+ touch /mnt/lustre/readdir/newentry
+# OBD_FAIL_MDS_READPAGE_NET|OBD_FAIL_ONCE
+ do_facet mds "sysctl -w lustre.fail_loc=0x80000104"
+ ls /mnt/lustre/readdir || return 1
+ do_facet mds "sysctl -w lustre.fail_loc=0"
+ rm -rf /mnt/lustre/readdir
+}
+run_test 13 "mdc_readpage restart test (bug 1138)"
+
+# Bug 113, check that readdir lost send timeout works.
+test_14() {
+ mkdir /mnt/lustre/readdir
+ touch /mnt/lustre/readdir/newentry
+# OBD_FAIL_MDS_SENDPAGE|OBD_FAIL_ONCE
+ do_facet mds "sysctl -w lustre.fail_loc=0x80000106"
+ ls /mnt/lustre/readdir || return 1
+ do_facet mds "sysctl -w lustre.fail_loc=0"
+}
+run_test 14 "mdc_readpage resend test (bug 1138)"
+
+test_15() {
+ do_facet mds "sysctl -w lustre.fail_loc=0x80000128"
+ touch $DIR/$tfile && return 1
+ return 0
+}
+run_test 15 "failed open (-ENOMEM)"
+
+test_16() {
+# OBD_FAIL_PTLRPC_BULK_PUT_NET | OBD_FAIL_ONCE
+ do_facet client cp /etc/termcap $MOUNT
+ sync
+
+ sysctl -w lustre.fail_loc=0x80000504
+ cancel_lru_locks OSC
+ # wil get evicted here
+ do_facet client "diff /etc/termcap $MOUNT/termcap" && return 1
+ sysctl -w lustre.fail_loc=0
+ do_facet client "diff /etc/termcap $MOUNT/termcap" || return 2
+
+}
+run_test 16 "timeout bulk put, evict client (2732)"
+
+test_17() {
+# OBD_FAIL_PTLRPC_BULK_GET_NET | OBD_FAIL_ONCE
+ # wil get evicted here
+ sysctl -w lustre.fail_loc=0x80000503
+ do_facet client cp /etc/termcap $MOUNT && return 1
+
+ do_facet client "diff /etc/termcap $MOUNT/termcap" && return 1
+ sysctl -w lustre.fail_loc=0
+ do_facet client "diff /etc/termcap $MOUNT/termcap" || return 2
+
+}
+run_test 17 "timeout bulk get, evict client (2732)"
+
+test_18() {
+# OBD_FAIL_PTLRPC_BULK_PUT_NET|OBD_FAIL_ONCE
+ do_facet client mkdir -p $MOUNT/$tdir
+ f=$MOUNT/$tdir/$tfile
+ f2=$MOUNT/$tdir/${tfile}-2
+
+ cancel_lru_locks OSC
+ for a in /proc/fs/lustre/llite/*/dump_page_cache; do
+ if [ `wc -l $a | awk '{print $1}'` -gt 1 ]; then
+ echo there is still data in page cache $a ?
+ cat $a;
+ return 1;
+ fi
+ done
+
+ # shouldn't have to set stripe size of count==1
+ lfs setstripe $f $((128 * 1024)) 0 1
+ lfs setstripe $f2 $((128 * 1024)) 0 1
+
+ do_facet client cp /etc/termcap $f
+ sync
+ # just use this write to trigger the client's eviction from the ost
+ sysctl -w lustre.fail_loc=0x80000503
+ do_facet client dd if=/dev/zero of=$f2 bs=4k count=1
+ sync
+ sysctl -w lustre.fail_loc=0
+ # allow recovery to complete
+ sleep 10
+ # my understanding is that there should be nothing in the page
+ # cache after the client reconnects?
+ for a in /proc/fs/lustre/llite/*/dump_page_cache; do
+ if [ `wc -l $a | awk '{print $1}'` -gt 1 ]; then
+ echo there is still data in page cache $a ?
+ cat $a;
+ return 1;
+ fi
+ done
+}
+run_test 18 "eviction and reconnect clears page cache (2766)"
+