+test_28() {
+ $LFS setstripe -i 0 -c 1 $DIR2/$tfile
+ dd if=/dev/zero of=$DIR2/$tfile bs=4096 count=1
+
+ #define OBD_FAIL_LDLM_SRV_BL_AST 0x324
+ do_facet ost1 $LCTL set_param fail_loc=0x80000324
+
+ dd if=/dev/zero of=$DIR/$tfile bs=4096 count=1 &
+ local pid=$!
+ sleep 2
+
+ #define OBD_FAIL_LDLM_GRANT_CHECK 0x32a
+ do_facet ost1 $LCTL set_param fail_loc=0x32a
+
+ fail ost1
+
+ sleep 2
+ cancel_lru_locks OST0000-osc
+ wait $pid || error "dd failed"
+}
+run_test 28 "lock replay should be ordered: waiting after granted"
+
+test_29() {
+ local dir0=$DIR/$tdir/d0
+ local dir1=$DIR/$tdir/d1
+
+ [ $MDSCOUNT -lt 2 ] && skip "needs >= 2 MDTs" && return 0
+ [ $CLIENTCOUNT -lt 2 ] && skip "needs >= 2 clients" && return 0
+ [ "$CLIENT1" == "$CLIENT2" ] &&
+ skip "clients must be on different nodes" && return 0
+
+ mkdir -p $DIR/$tdir
+ $LFS mkdir -i0 $dir0
+ $LFS mkdir -i1 $dir1
+ sync
+
+ replay_barrier mds2
+ # create a remote dir, drop reply
+ #define OBD_FAIL_PTLRPC_ROUND_XID 0x530
+ $LCTL set_param fail_loc=0x530 fail_val=36
+ #define OBD_FAIL_MDS_REINT_MULTI_NET_REP 0x15a
+ do_facet mds2 $LCTL set_param fail_loc=0x8000015a
+ echo make remote dir d0 for $dir0
+ $LFS mkdir -i1 -c1 $dir0/d3 &
+ sleep 1
+
+ echo make local dir d1 for $dir1
+ do_node $CLIENT2 $LCTL set_param fail_loc=0x530 fail_val=36
+ do_node $CLIENT2 mkdir $dir1/d4
+
+ fail mds2
+}
+run_test 29 "replay vs update with the same xid"
+
+test_30() {
+ $LFS setstripe -E 1m -L mdt -E -1 $DIR/$tfile
+ #first write to have no problems with grants
+ dd if=/dev/zero of=$DIR/$tfile bs=4k count=10 ||
+ error "dd on client failed"
+ dd if=/dev/zero of=$DIR/$tfile bs=4k count=10 seek=10 ||
+ error "dd on client failed"
+
+ #define OBD_FAIL_LDLM_REPLAY_PAUSE 0x32e
+ lctl set_param fail_loc=0x32e fail_val=4
+ dd of=/dev/null if=$DIR2/$tfile &
+ local pid=$!
+ sleep 1
+
+ fail $SINGLEMDS
+
+ wait $pid || error "dd on client failed"
+}
+run_test 30 "layout lock replay is not blocked on IO"
+