ENTRY;
LASSERT(env != NULL);
- LASSERT(objcount == 1);
+ if (objcount != 1) {
+ CERROR("%s: this server only supports 1 object per RPC\n",
+ ofd_name(ofd));
+ GOTO(out, rc = -EPROTO);
+ }
if (unlikely(exp->exp_obd->obd_recovering)) {
u64 seq = ostid_seq(&oa->o_oi);
ofd_seq_put(env, oseq);
}
- LASSERT(objcount == 1);
+ if (objcount != 1) {
+ CERROR("%s: this server only supports 1 object per RPC\n",
+ ofd_name(ofd));
+ RETURN(rc = -EPROTO);
+ }
LASSERT(obj->ioo_bufcnt > 0);
if (cmd == OBD_BRW_WRITE) {
ENTRY;
- LASSERT(objcount == 1);
-
fo = ofd_info(env)->fti_obj;
LASSERT(fo != NULL);
o = ofd_object_child(fo);
LASSERT(o != NULL);
+ if (objcount != 1) {
+ CERROR("%s: this server only supports 1 object per RPC\n",
+ ofd_name(ofd));
+ GOTO(out, rc = -EPROTO);
+ }
if (old_rc)
GOTO(out, rc = old_rc);
if (!ofd_object_exists(fo))
objcount = req_capsule_get_size(&req->rq_pill, &RMF_OBD_IOOBJ,
RCL_CLIENT) / sizeof(*ioo);
+ /* there are currently never multiple objects in one RPC, and parts of
+ * this code assume one object, so assert it for now (the loop after
+ * this is part of the incomplete handling for multiple objects in an
+ * RPC, so it is left here to help if we add multi-object RPCs in
+ * future)
+ */
+ if (objcount != 1) {
+ CERROR("%s: this server only supports 1 object per RPC\n",
+ tgt_name(tsi->tsi_tgt));
+ GOTO(out, rc = -EPROTO);
+ }
for (niocount = i = 0; i < objcount; i++)
niocount += ioo[i].ioo_bufcnt;