+run_test 16 "timeout bulk put, evict client (2732)"
+
+test_17() {
+ # OBD_FAIL_PTLRPC_BULK_GET_NET 0x0503 | OBD_FAIL_ONCE
+ # client will get evicted here
+ sysctl -w lustre.fail_loc=0x80000503
+ do_facet client cp /etc/termcap $DIR/$tfile
+
+ sleep $RECOV_TIMEOUT
+ sysctl -w lustre.fail_loc=0
+ do_facet client "df $DIR"
+ # expect cmp to fail
+ do_facet client "cmp /etc/termcap $DIR/$tfile" && return 1
+ do_facet client "rm $DIR/$tfile" || return 2
+ return 0
+}
+run_test 17 "timeout bulk get, evict client (2732)"
+
+test_18a() {
+ do_facet client mkdir -p $MOUNT/$tdir
+ f=$MOUNT/$tdir/$tfile
+
+ cancel_lru_locks OSC
+ pgcache_empty || return 1
+
+ # 1 stripe on ost2
+ lfs setstripe $f $((128 * 1024)) 1 1
+
+ do_facet client cp /etc/termcap $f
+ sync
+ local osc2_dev=`$LCTL device_list | \
+ awk '(/ost2.*client_facet/){print $4}' `
+ $LCTL --device %$osc2_dev deactivate
+ # my understanding is that there should be nothing in the page
+ # cache after the client reconnects?
+ rc=0
+ pgcache_empty || rc=2
+ $LCTL --device %$osc2_dev activate
+ rm -f $f
+ return $rc
+}
+run_test 18a "manual ost invalidate clears page cache immediately"
+
+test_18b() {
+# 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
+ pgcache_empty || return 1
+
+ # 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 $((TIMEOUT + 2))
+ # my understanding is that there should be nothing in the page
+ # cache after the client reconnects?
+ rc=0
+ pgcache_empty || rc=2
+ rm -f $f $f2
+ return $rc
+}
+run_test 18b "eviction and reconnect clears page cache (2766)"