#define OBD_FAIL_MDS_RENAME2 0x154
#define OBD_FAIL_MDS_RENAME3 0x155
#define OBD_FAIL_MDS_RENAME4 0x156
+#define OBD_FAIL_MDS_LDLM_REPLY_NET 0x157
/* layout lock */
#define OBD_FAIL_MDS_NO_LL_GETATTR 0x170
#define OBD_FAIL_LDLM_CP_CB_WAIT4 0x322
#define OBD_FAIL_LDLM_CP_CB_WAIT5 0x323
+#define OBD_FAIL_LDLM_SRV_BL_AST 0x324
+#define OBD_FAIL_LDLM_SRV_CP_AST 0x325
+#define OBD_FAIL_LDLM_SRV_GL_AST 0x326
+
/* LOCKLESS IO */
#define OBD_FAIL_LDLM_SET_CONTENTION 0x385
#define OBD_FAIL_TGT_REPLAY_DROP 0x707
#define OBD_FAIL_TGT_FAKE_EXP 0x708
#define OBD_FAIL_TGT_REPLAY_DELAY 0x709
-#define OBD_FAIL_TGT_LAST_REPLAY 0x710
+/* #define OBD_FAIL_TGT_LAST_REPLAY 0x710 (obsoleted) */
#define OBD_FAIL_TGT_CLIENT_ADD 0x711
#define OBD_FAIL_TGT_RCVG_FLAG 0x712
#define OBD_FAIL_TGT_DELAY_CONDITIONAL 0x713
#define OBD_FAIL_MGS_TARGET_REG_NET 0x90a
#define OBD_FAIL_MGS_TARGET_DEL_NET 0x90b
#define OBD_FAIL_MGS_CONFIG_READ_NET 0x90c
+#define OBD_FAIL_MGS_LDLM_REPLY_NET 0x90d
#define OBD_FAIL_QUOTA_DQACQ_NET 0xA01
#define OBD_FAIL_QUOTA_EDQUOT 0xA02
#define OBD_FAIL_ONCE CFS_FAIL_ONCE
#define OBD_FAILED CFS_FAILED
+#define LUT_FAIL_CLASS(fail_id) (((fail_id) >> 8) << 16)
+#define LUT_FAIL_MGT LUT_FAIL_CLASS(OBD_FAIL_MGS)
+#define LUT_FAIL_MDT LUT_FAIL_CLASS(OBD_FAIL_MDS)
+#define LUT_FAIL_OST LUT_FAIL_CLASS(OBD_FAIL_OST)
+
extern atomic_t libcfs_kmemory;
#ifdef CONFIG_PROC_FS
LASSERT(lock != NULL);
LASSERT(data != NULL);
- if (OBD_FAIL_PRECHECK(OBD_FAIL_OST_LDLM_REPLY_NET)) {
+ if (OBD_FAIL_PRECHECK(OBD_FAIL_LDLM_SRV_CP_AST)) {
LDLM_DEBUG(lock, "dropping CP AST");
RETURN(0);
}
ctxt = llog_get_context(d->opd_obd, LLOG_MDS_OST_ORIG_CTXT);
if (ctxt == NULL)
RETURN(-ENOMEM);
+
rc = llog_add(env, ctxt->loc_handle, &osi->osi_hdr, &osi->osi_cookie,
th);
llog_ctxt_put(ctxt);
- CDEBUG(D_OTHER, "%s: new record "DOSTID":%lu/%lu: %d\n",
- d->opd_obd->obd_name, POSTID(&osi->osi_cookie.lgc_lgl.lgl_oi),
- (unsigned long) osi->osi_cookie.lgc_lgl.lgl_ogen,
- (unsigned long) osi->osi_cookie.lgc_index, rc);
-
- if (rc > 0)
- rc = 0;
-
- if (likely(rc == 0)) {
+ if (likely(rc >= 0)) {
+ CDEBUG(D_OTHER, "%s: new record "DOSTID":%lu/%lu: %d\n",
+ d->opd_obd->obd_name,
+ POSTID(&osi->osi_cookie.lgc_lgl.lgl_oi),
+ (unsigned long)osi->osi_cookie.lgc_lgl.lgl_ogen,
+ (unsigned long)osi->osi_cookie.lgc_index, rc);
spin_lock(&d->opd_syn_lock);
d->opd_syn_changes++;
spin_unlock(&d->opd_syn_lock);
}
-
- RETURN(rc);
+ /* return 0 always here, error case just cause no llog record */
+ RETURN(0);
}
int osp_sync_add(const struct lu_env *env, struct osp_object *o,
if (rc)
RETURN(err_serious(rc));
+ switch (LUT_FAIL_CLASS(tsi->tsi_reply_fail_id)) {
+ case LUT_FAIL_MDT:
+ tsi->tsi_reply_fail_id = OBD_FAIL_MDS_LDLM_REPLY_NET;
+ break;
+ case LUT_FAIL_OST:
+ tsi->tsi_reply_fail_id = OBD_FAIL_OST_LDLM_REPLY_NET;
+ break;
+ case LUT_FAIL_MGT:
+ tsi->tsi_reply_fail_id = OBD_FAIL_MGS_LDLM_REPLY_NET;
+ break;
+ default:
+ tsi->tsi_reply_fail_id = OBD_FAIL_LDLM_REPLY;
+ break;
+ }
RETURN(req->rq_status);
}
EXPORT_SYMBOL(tgt_enqueue);
drop_ldlm_cancel "multiop $DIR2/$tfile Ow512" &
sleep 1
-#define OBD_FAIL_OST_LDLM_REPLY_NET 0x213
# failover, replay and resend replayed waiting locks
- do_facet ost1 lctl set_param fail_loc=0x80000213
+ if [ $(lustre_version_code ost1) -ge $(version_code 2.6.90) ]; then
+ #define OBD_FAIL_LDLM_SRV_CP_AST 0x325
+ do_facet ost1 lctl set_param fail_loc=0x80000325
+ else
+ #define OBD_FAIL_OST_LDLM_REPLY_NET 0x213
+ do_facet ost1 lctl set_param fail_loc=0x80000213
+ fi
+
fail ost1
# multiop does not finish because CP AST is skipped;
# b3764 timed out lock replay
test_52() {
- touch $DIR/$tfile
- cancel_lru_locks mdc
+ [ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.6.90) ] &&
+ skip "MDS prior to 2.6.90 handle LDLM_REPLY_NET incorrectly" &&
+ return 0
- multiop $DIR/$tfile s || return 1
- replay_barrier $SINGLEMDS
-#define OBD_FAIL_LDLM_REPLY 0x30c
- do_facet $SINGLEMDS "lctl set_param fail_loc=0x8000030c"
- fail $SINGLEMDS || return 2
- do_facet $SINGLEMDS "lctl set_param fail_loc=0x0"
+ touch $DIR/$tfile
+ cancel_lru_locks mdc
+
+ multiop_bg_pause $DIR/$tfile s_s || return 1
+ mpid=$!
+
+ #define OBD_FAIL_MDS_LDLM_REPLY_NET 0x157
+ lctl set_param -n ldlm.cancel_unused_locks_before_replay "0"
+ do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000157"
- $CHECKSTAT -t file $DIR/$tfile-* && return 3 || true
+ fail $SINGLEMDS || return 2
+ kill -USR1 $mpid
+ wait $mpid || return 3
+
+ do_facet $SINGLEMDS "lctl set_param fail_loc=0x0"
+ lctl set_param fail_loc=0x0
+ lctl set_param -n ldlm.cancel_unused_locks_before_replay "1"
+ rm -f $DIR/$tfile
}
run_test 52 "time out lock replay (3764)"
}
run_test 73b "open(O_CREAT), unlink, replay, reconnect at open_replay reply, close"
-test_73c() {
- multiop_bg_pause $DIR/$tfile O_tSc || return 3
- pid=$!
- rm -f $DIR/$tfile
-
- replay_barrier $SINGLEMDS
-#define OBD_FAIL_TGT_LAST_REPLAY 0x710
- do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000710"
- fail $SINGLEMDS
- kill -USR1 $pid
- wait $pid || return 1
- [ -e $DIR/$tfile ] && return 2
- return 0
-}
-run_test 73c "open(O_CREAT), unlink, replay, reconnect at last_replay, close"
-
# bug 18554
test_74() {
local clients=${CLIENTS:-$HOSTNAME}
local remote_dir=$DIR/$tdir/remote_dir
mkdir -p $DIR/$tdir
- #define OBD_FAIL_UPDATE_OBJ_NET_REP 0x1701
+ #define OBD_FAIL_OUT_UPDATE_NET_REP 0x1701
do_facet mds${MDTIDX} lctl set_param fail_loc=0x1701
$LFS mkdir -i $MDTIDX $remote_dir &
local CLIENT_PID=$!
}
run_test 81h "DNE: unlink remote dir, drop request reply, fail 2 MDTs"
-test_83a() {
- mkdir -p $DIR/$tdir
- createmany -o $DIR/$tdir/$tfile- 10 || return 1
-#define OBD_FAIL_MDS_FAIL_LOV_LOG_ADD 0x140
- do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000140"
- unlinkmany $DIR/$tdir/$tfile- 10 || return 2
-}
-run_test 83a "fail log_add during unlink recovery"
-
-test_83b() {
- mkdir -p $DIR/$tdir
- createmany -o $DIR/$tdir/$tfile- 10 || return 1
- replay_barrier $SINGLEMDS
- unlinkmany $DIR/$tdir/$tfile- 10 || return 2
-#define OBD_FAIL_MDS_FAIL_LOV_LOG_ADD 0x140
- do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000140"
- fail $SINGLEMDS
-}
-run_test 83b "fail log_add during unlink recovery"
-
test_84a() {
#define OBD_FAIL_MDS_OPEN_WAIT_CREATE 0x144
do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000144"
#otherwise it may create single stripe dir here
$LFS setdirstripe -i1 $DIR/$tdir/remote_dir
- #define OBD_FAIL_UPDATE_OBJ_NET_REP 0x1701
+ #define OBD_FAIL_OUT_UPDATE_NET_REP 0x1701
do_facet mds$((MDTIDX+1)) lctl set_param fail_loc=0x1701
$LFS setdirstripe -i0 -c2 $striped_dir &
local CLIENT_PID=$!