removed cwd "./" (refer to Bugzilla 14399).
* File join has been disabled in this release, refer to Bugzilla 16929.
+Severity : enhancement
+Bugzilla : 19526
+Description: correctly handle big reply message.
+Details : send LNet event if reply is bigger then buffer and adjust this buffer
+ correctly.
+
Severity : normal
Bugzilla : 19917
Description: Drop unnecessary __GFP_NOMEMALLOC flag from filter_get_page()
EXIT;
}
-struct mdc_cache_waiter {
+static inline void mdc_update_max_ea_from_body(struct obd_export *exp,
+ struct mdt_body *body)
+{
+ if (body->valid & OBD_MD_FLMODEASIZE) {
+ if (exp->exp_obd->u.cli.cl_max_mds_easize < body->max_mdsize)
+ exp->exp_obd->u.cli.cl_max_mds_easize =
+ body->max_mdsize;
+ if (exp->exp_obd->u.cli.cl_max_mds_cookiesize <
+ body->max_cookiesize)
+ exp->exp_obd->u.cli.cl_max_mds_cookiesize =
+ body->max_cookiesize;
+ }
+}
+
+
+struct mdc_cache_waiter {
struct list_head mcw_entry;
cfs_waitq_t mcw_waitq;
};
/* server-side flags */
rq_packed_final:1, /* packed final reply */
rq_hp:1, /* high priority RPC */
- rq_at_linked:1; /* link into service's srv_at_array */
+ rq_at_linked:1, /* link into service's srv_at_array */
+ rq_reply_truncate:1;
enum rq_phase rq_phase; /* one of RQ_PHASE_* */
enum rq_phase rq_next_phase; /* one of RQ_PHASE_* to be used next */
if ((body->valid & (OBD_MD_FLDIREA | OBD_MD_FLEASIZE)) != 0) {
void *eadata;
+ mdc_update_max_ea_from_body(exp, body);
+
/*
* The eadata is opaque; just check that it is there.
* Eventually, obd_unpackmd() will check the contents.
CDEBUG(D_NET, "mode: %o\n", body->mode);
if (body->eadatasize != 0) {
+ mdc_update_max_ea_from_body(exp, body);
+
eadata = req_capsule_server_sized_get(pill, &RMF_MDT_MD,
body->eadatasize);
if (eadata == NULL)
LASSERT(obd);
LASSERT(req->rq_nob_received <= req->rq_repbuf_len);
+ if (req->rq_reply_truncate && !req->rq_no_resend) {
+ req->rq_resend = 1;
+ sptlrpc_cli_free_repbuf(req);
+ req->rq_replen = req->rq_nob_received;
+ RETURN(0);
+ }
+
/*
* NB Until this point, the whole of the incoming message,
* including buflens, status etc is in the sender's byte order.
if (req->rq_err) {
/* rq_status was set locally */
- rc = -EIO;
+ rc = req->rq_status ? req->rq_status : -EIO;
}
else if (req->rq_intr) {
rc = -EINTR;
}
else if (req->rq_no_resend) {
- spin_unlock(&imp->imp_lock);
- GOTO(out, rc = -ETIMEDOUT);
- }
- else {
+ rc = -ETIMEDOUT;
+ } else {
GOTO(restart, rc);
}
}
if (req->rq_err) {
DEBUG_REQ(D_RPCTRACE, req, "err rc=%d status=%d",
rc, req->rq_status);
+ rc = rc ? rc : req->rq_status;
GOTO(out, rc = rc ? rc : -EIO);
}
if (ev->status)
goto out_wake;
+
if (ev->type == LNET_EVENT_UNLINK) {
LASSERT(ev->unlinked);
DEBUG_REQ(D_RPCTRACE, req, "unlink");
goto out_wake;
}
+ if (ev->mlength < ev->rlength ) {
+ CDEBUG(D_RPCTRACE, "truncate req %p rpc %d - %d+%d\n", req,
+ req->rq_replen, ev->rlength, ev->offset);
+ req->rq_reply_truncate = 1;
+ req->rq_replied = 1;
+ req->rq_status = -EOVERFLOW;
+ req->rq_nob_received = ev->rlength + ev->offset;
+ goto out_wake;
+ }
+
if ((ev->offset == 0) &&
((lustre_msghdr_get_flags(req->rq_reqmsg) & MSGHDR_AT_SUPPORT))) {
/* Early reply */
request->rq_net_err = 0;
request->rq_resend = 0;
request->rq_restart = 0;
+ request->rq_reply_truncate = 0;
spin_unlock(&request->rq_lock);
if (!noreply) {
reply_md.threshold = LNET_MD_THRESH_INF;
/* Manage remote for early replies */
reply_md.options = PTLRPC_MD_OPTIONS | LNET_MD_OP_PUT |
- LNET_MD_MANAGE_REMOTE;
+ LNET_MD_MANAGE_REMOTE |
+ LNET_MD_TRUNCATE; /* allow to make EOVERFLOW error */;
reply_md.user_ptr = &request->rq_reply_cbid;
reply_md.eq_handle = ptlrpc_eq_h;