require_dsh_mds || exit 0
# also long tests: 19, 21a, 21e, 21f, 23, 27
-# 1 2.5 2.5 4 4 (min)"
-[ "$SLOW" = "no" ] && EXCEPT_SLOW="17 26a 26b 50 51 57"
+
+[ "$SLOW" = "no" ] && EXCEPT_SLOW=""
[ $(facet_fstype $SINGLEMDS) = "zfs" ] &&
# bug number for skipped test: LU-2547
#b=2494
test_12(){
- $LCTL mark $MULTIOP $DIR/$tfile OS_c
+ $LCTL mark "$HOSTNAME: $MULTIOP $DIR/$tfile OS_c"
do_facet $SINGLEMDS "lctl set_param fail_loc=0x115"
clear_failloc $SINGLEMDS $((TIMEOUT * 2)) &
multiop_bg_pause $DIR/$tfile OS_c ||
}
run_test 113 "ldlm enqueue dropped reply should not cause deadlocks"
+T130_PID=0
+test_130_base() {
+ test_mkdir -p $DIR/$tdir
+
+ # Prevent interference from layout intent RPCs due to
+ # asynchronous writeback. These will be tested in 130c below.
+ do_nodes ${CLIENTS:-$HOSTNAME} sync
+
+ # get only LOOKUP lock on $tdir
+ cancel_lru_locks mdc
+ ls $DIR/$tdir/$tfile 2>/dev/null
+
+ # get getattr by fid on $tdir
+ #
+ # we need to race with unlink, unlink must complete before we will
+ # take a DLM lock, otherwise unlink will wait until getattr will
+ # complete; but later than getattr starts so that getattr found
+ # the object
+#define OBD_FAIL_MDS_INTENT_DELAY 0x160
+ set_nodes_failloc "$(mdts_nodes)" 0x80000160
+ stat $DIR/$tdir &
+ T130_PID=$!
+ sleep 2
+
+ rm -rf $DIR/$tdir
+
+ # drop the reply so that resend happens on an unlinked file.
+#define OBD_FAIL_MDS_LDLM_REPLY_NET 0x157
+ set_nodes_failloc "$(mdts_nodes)" 0x80000157
+}
+
+test_130a() {
+ remote_mds_nodsh && skip "remote MDS with nodsh" && return
+ test_130_base
+
+ wait $T130_PID || [ $? -eq 0 ] && error "stat should fail"
+ return 0
+}
+run_test 130a "enqueue resend on not existing file"
+
+test_130b() {
+ remote_mds_nodsh && skip "remote MDS with nodsh" && return
+ test_130_base
+ # let the reply to be dropped
+ sleep 10
+
+#define OBD_FAIL_SRV_ENOENT 0x217
+ set_nodes_failloc "$(mdts_nodes)" 0x80000217
+
+ wait $T130_PID || [ $? -eq 0 ] && error "stat should fail"
+ return 0
+}
+run_test 130b "enqueue resend on a stale inode"
+
+test_130c() {
+ remote_mds_nodsh && skip "remote MDS with nodsh" && return
+
+ do_nodes ${CLIENTS:-$HOSTNAME} sync
+ echo XXX > $DIR/$tfile
+
+ cancel_lru_locks mdc
+
+ # Trigger writeback on $tfile.
+ #
+ # we need to race with unlink, unlink must complete before we will
+ # take a DLM lock, otherwise unlink will wait until intent will
+ # complete; but later than intent starts so that intent found
+ # the object
+#define OBD_FAIL_MDS_INTENT_DELAY 0x160
+ set_nodes_failloc "$(mdts_nodes)" 0x80000160
+ sync &
+ T130_PID=$!
+ sleep 2
+
+ rm $DIR/$tfile
+
+ # drop the reply so that resend happens on an unlinked file.
+#define OBD_FAIL_MDS_LDLM_REPLY_NET 0x157
+ set_nodes_failloc "$(mdts_nodes)" 0x80000157
+
+ # let the reply to be dropped
+ sleep 10
+
+#define OBD_FAIL_SRV_ENOENT 0x217
+ set_nodes_failloc "$(mdts_nodes)" 0x80000217
+
+ wait $T130_PID
+
+ return 0
+}
+run_test 130c "layout intent resend on a stale inode"
+
complete $SECONDS
check_and_cleanup_lustre
exit_status