#define OBD_FAIL_PTLRPC_FINISH_REPLAY 0x514
#define OBD_FAIL_PTLRPC_CLIENT_BULK_CB2 0x515
#define OBD_FAIL_PTLRPC_DELAY_IMP_FULL 0x516
+#define OBD_FAIL_PTLRPC_CANCEL_RESEND 0x517
#define OBD_FAIL_OBD_PING_NET 0x600
#define OBD_FAIL_OBD_LOG_CANCEL_NET 0x601
case LDLM_CANCEL:
req_capsule_set(&req->rq_pill, &RQF_LDLM_CANCEL);
CDEBUG(D_INODE, "cancel\n");
- if (OBD_FAIL_CHECK(OBD_FAIL_LDLM_CANCEL_NET))
+ if (CFS_FAIL_CHECK(OBD_FAIL_LDLM_CANCEL_NET) ||
+ CFS_FAIL_CHECK(OBD_FAIL_PTLRPC_CANCEL_RESEND))
RETURN(0);
rc = ldlm_handle_cancel(req);
if (rc)
ptlrpc_request_free(req);
GOTO(out, rc);
}
- req->rq_no_resend = 1;
- req->rq_no_delay = 1;
req->rq_request_portal = LDLM_CANCEL_REQUEST_PORTAL;
req->rq_reply_portal = LDLM_CANCEL_REPLY_PORTAL;
}
#endif
- obd_cancel_unused(sbi->ll_dt_exp, NULL, 0, NULL);
-
ll_close_thread_shutdown(sbi->ll_lcq);
cl_sb_fini(sb);
static int ptlrpc_server_allow_high(struct ptlrpc_service_part *svcpt,
int force)
{
+ int running = svcpt->scp_nthrs_running;
+
if (force)
return 1;
- if (svcpt->scp_nreqs_active >= svcpt->scp_nthrs_running - 1)
+ if (unlikely(svcpt->scp_service->srv_req_portal == MDS_REQUEST_PORTAL &&
+ CFS_FAIL_PRECHECK(OBD_FAIL_PTLRPC_CANCEL_RESEND))) {
+ /* leave just 1 thread for normal RPCs */
+ running = PTLRPC_NTHRS_INIT;
+ if (svcpt->scp_service->srv_ops.so_hpreq_handler != NULL)
+ running += 1;
+ }
+
+ if (svcpt->scp_nreqs_active >= running - 1)
return 0;
if (svcpt->scp_nhreqs_active == 0)
static int ptlrpc_server_allow_normal(struct ptlrpc_service_part *svcpt,
int force)
{
+ int running = svcpt->scp_nthrs_running;
#ifndef __KERNEL__
if (1) /* always allow to handle normal request for liblustre */
return 1;
#endif
+ if (unlikely(svcpt->scp_service->srv_req_portal == MDS_REQUEST_PORTAL &&
+ CFS_FAIL_PRECHECK(OBD_FAIL_PTLRPC_CANCEL_RESEND))) {
+ /* leave just 1 thread for normal RPCs */
+ running = PTLRPC_NTHRS_INIT;
+ if (svcpt->scp_service->srv_ops.so_hpreq_handler != NULL)
+ running += 1;
+ }
+
if (force ||
- svcpt->scp_nreqs_active < svcpt->scp_nthrs_running - 2)
+ svcpt->scp_nreqs_active < running - 2)
return 1;
- if (svcpt->scp_nreqs_active >= svcpt->scp_nthrs_running - 1)
+ if (svcpt->scp_nreqs_active >= running - 1)
return 0;
return svcpt->scp_nhreqs_active > 0 ||
}
run_test 19b "test expired_lock_main on ost (2867)"
+test_19c() {
+ local BEFORE=`date +%s`
+
+ mount_client $DIR2
+ $LCTL set_param ldlm.namespaces.*.early_lock_cancel=0
+
+ mkdir -p $DIR1/$tfile
+ stat $DIR1/$tfile
+
+#define OBD_FAIL_PTLRPC_CANCEL_RESEND 0x516
+ do_facet mds $LCTL set_param fail_loc=0x80000516
+
+ touch $DIR2/$tfile/file1 &
+ PID1=$!
+ # let touch to get blocked on the server
+ sleep 2
+
+ wait $PID1
+ $LCTL set_param ldlm.namespaces.*.early_lock_cancel=1
+ umount_client $DIR2
+
+ # let the client reconnect
+ sleep 5
+ EVICT=$(do_facet client $LCTL get_param mdc.$FSNAME-MDT*.state |
+ awk -F"[ [,]" '/EVICTED]$/ { if (mx<$4) {mx=$4;} } END { print mx }')
+
+ [ -z "$EVICT" ] || [[ $EVICT -le $BEFORE ]] || error "eviction happened"
+}
+run_test 19c "check reconnect and lock resend do not trigger expired_lock_main"
+
test_20a() { # bug 2983 - ldlm_handle_enqueue cleanup
remote_ost_nodsh && skip "remote OST with nodsh" && return 0