- LASSERT(desc->bd_nob == rdpg->rp_count);
- rc = sptlrpc_svc_wrap_bulk(req, desc);
- if (rc)
- GOTO(free_desc, rc);
-
- rc = ptlrpc_start_bulk_transfer(desc);
- if (rc)
- GOTO(free_desc, rc);
-
- if (OBD_FAIL_CHECK(OBD_FAIL_MDS_SENDPAGE))
- GOTO(abort_bulk, rc = 0);
-
- timeout = (int) req->rq_deadline - cfs_time_current_sec();
- if (timeout < 0)
- CERROR("Req deadline already passed %lu (now: %lu)\n",
- req->rq_deadline, cfs_time_current_sec());
- *lwi = LWI_TIMEOUT_INTERVAL(cfs_time_seconds(max(timeout, 1)),
- cfs_time_seconds(1), NULL, NULL);
- rc = l_wait_event(desc->bd_waitq, !ptlrpc_server_bulk_active(desc) ||
- exp->exp_failed || exp->exp_abort_active_req, lwi);
- LASSERT (rc == 0 || rc == -ETIMEDOUT);
-
- if (rc == 0) {
- if (desc->bd_success &&
- desc->bd_nob_transferred == rdpg->rp_count)
- GOTO(free_desc, rc);
-
- rc = -ETIMEDOUT;
- if (exp->exp_abort_active_req || exp->exp_failed)
- GOTO(abort_bulk, rc);
- }
-
- DEBUG_REQ(D_ERROR, req, "bulk failed: %s %d(%d), evicting %s@%s",
- (rc == -ETIMEDOUT) ? "timeout" : "network error",
- desc->bd_nob_transferred, rdpg->rp_count,
- exp->exp_client_uuid.uuid,
- exp->exp_connection->c_remote_uuid.uuid);
-
- class_fail_export(exp);
-
- EXIT;
-abort_bulk:
- ptlrpc_abort_bulk(desc);
-free_desc: