@@ -314,7 +314,6 @@ int fld_client_rpc(struct obd_export *exp,
LASSERT(exp);
-again:
imp = class_exp2cliimp(exp);
switch (fld_op) {
case FLD_QUERY:
@@ -363,17 +362,23 @@ int fld_client_rpc(struct obd_export *exp,
req->rq_reply_portal = MDC_REPLY_PORTAL;
ptlrpc_at_set_req_timeout(req);
- obd_get_request_slot(&exp->exp_obd->u.cli);
- rc = ptlrpc_queue_wait(req);
- obd_put_request_slot(&exp->exp_obd->u.cli);
+ if (OBD_FAIL_CHECK(OBD_FAIL_FLD_QUERY_REQ && req->rq_no_delay)) {
+ /* the same error returned by ptlrpc_import_delay_req */
+ rc = -EWOULDBLOCK;
+ req->rq_status = rc;
+ } else {
+ obd_get_request_slot(&exp->exp_obd->u.cli);
+ rc = ptlrpc_queue_wait(req);
+ obd_put_request_slot(&exp->exp_obd->u.cli);
+ }
+
if (rc != 0) {
if (imp->imp_state != LUSTRE_IMP_CLOSED && !imp->imp_deactive) {
- /* Since LWP is not replayable, so it will keep
- * trying unless umount happens, otherwise it would
- * cause unnecessary failure of the application.
+ /*
+ * Since LWP is not replayable, so notify the caller
+ * to retry if needed after a while.
*/
- ptlrpc_req_finished(req);
- goto again;
+ rc = -EAGAIN;
}
goto out_req;
}
@@ -424,6 +424,7 @@
#define OBD_FAIL_FLD 0x1100
#define OBD_FAIL_FLD_QUERY_NET 0x1101
#define OBD_FAIL_FLD_READ_NET 0x1102
+#define OBD_FAIL_FLD_QUERY_REQ 0x1103
#define OBD_FAIL_SEC_CTX 0x1200
#define OBD_FAIL_SEC_CTX_INIT_NET 0x1201