+ reply_size += sizeof(*reply);
+
+ if (unlikely(reply_size > ouh->ouh_reply_size)) {
+ CERROR("%s: too small reply buf %u for %u, need %u at least\n",
+ tgt_name(tsi->tsi_tgt), ouh->ouh_reply_size,
+ updates, reply_size);
+ GOTO(out_free, rc = err_serious(-EPROTO));
+ }
+
+ req_capsule_set_size(pill, &RMF_OUT_UPDATE_REPLY, RCL_SERVER,
+ ouh->ouh_reply_size);
+ rc = req_capsule_server_pack(pill);
+ if (rc != 0) {
+ CERROR("%s: Can't pack response: rc = %d\n",
+ tgt_name(tsi->tsi_tgt), rc);
+ GOTO(out_free, rc = err_serious(-EPROTO));
+ }
+
+ /* Prepare the update reply buffer */
+ reply = req_capsule_server_get(pill, &RMF_OUT_UPDATE_REPLY);
+ if (reply == NULL)
+ GOTO(out_free, rc = -EPROTO);
+ reply->ourp_magic = UPDATE_REPLY_MAGIC;
+ reply->ourp_count = updates;
+ tti->tti_u.update.tti_update_reply = reply;
+ tti->tti_mult_trans = !req_is_replay(tgt_ses_req(tsi));
+