#define OBD_FAIL_PTLRPC_LONG_BOTH_UNLINK 0x51c
#define OBD_FAIL_PTLRPC_CLIENT_BULK_CB3 0x520
#define OBD_FAIL_PTLRPC_BULK_ATTACH 0x521
+#define OBD_FAIL_PTLRPC_BULK_REPLY_ATTACH 0x522
#define OBD_FAIL_PTLRPC_RESEND_RACE 0x525
#define OBD_FAIL_PTLRPC_ROUND_XID 0x530
#define OBD_FAIL_PTLRPC_CONNECT_RACE 0x531
LASSERT(!in_interrupt()); /* might sleep */
+ if (desc)
+ desc->bd_registered = 0;
+
/* Let's setup deadline for reply unlink. */
if (OBD_FAIL_CHECK(OBD_FAIL_PTLRPC_LONG_BULK_UNLINK) &&
async && req->rq_bulk_deadline == 0 && cfs_fail_val == 0)
request->rq_repmsg = NULL;
}
- reply_me = LNetMEAttach(request->rq_reply_portal,
- connection->c_peer, request->rq_xid, 0,
- LNET_UNLINK, LNET_INS_AFTER);
+ if (request->rq_bulk &&
+ OBD_FAIL_CHECK(OBD_FAIL_PTLRPC_BULK_REPLY_ATTACH)) {
+ reply_me = ERR_PTR(-ENOMEM);
+ } else {
+ reply_me = LNetMEAttach(request->rq_reply_portal,
+ connection->c_peer,
+ request->rq_xid, 0,
+ LNET_UNLINK, LNET_INS_AFTER);
+ }
+
if (IS_ERR(reply_me)) {
rc = PTR_ERR(reply_me);
CERROR("LNetMEAttach failed: %d\n", rc);
cleanup_bulk:
/* We do sync unlink here as there was no real transfer here so
* the chance to have long unlink to sluggish net is smaller here. */
- ptlrpc_unregister_bulk(request, 0);
- if (request->rq_bulk != NULL)
- request->rq_bulk->bd_registered = 0;
+ ptlrpc_unregister_bulk(request, 0);
out:
if (rc == -ENOMEM) {
/* set rq_sent so that this request is treated
}
run_test 423 "statfs should return a right data"
+test_424() {
+#define OBD_FAIL_PTLRPC_BULK_REPLY_ATTACH 0x522 | OBD_FAIL_ONCE
+ $LCTL set_param fail_loc=0x80000522
+ dd if=/dev/zero of=$DIR/$tfile bs=2M count=1 oflag=sync
+ rm -f $DIR/$tfile
+}
+run_test 424 "simulate ENOMEM in ptl_send_rpc bulk reply ME attach"
+
prep_801() {
[[ $MDS1_VERSION -lt $(version_code 2.9.55) ]] ||
[[ $OST1_VERSION -lt $(version_code 2.9.55) ]] &&