- LASSERT(fed->fed_ted.ted_lr_off > 0);
- err = lut_client_data_write(info->fti_env, &ofd->ofd_lut, lcd,
+ if (lw_client) {
+ /* Although lightweight (LW) connections have no slot in
+ * last_rcvd, we still want to maintain the in-memory
+ * lsd_client_data structure in order to properly handle reply
+ * reconstruction. */
+ struct lu_target *tg =&ofd->ofd_lut;
+ bool update = false;
+
+ err = 0;
+ /* All operations performed by LW clients are synchronous and
+ * we store the committed transno in the last_rcvd header */
+ spin_lock(&tg->lut_translock);
+ if (info->fti_transno > tg->lut_lsd.lsd_last_transno) {
+ tg->lut_lsd.lsd_last_transno = info->fti_transno;
+ update = true;
+ }
+ spin_unlock(&tg->lut_translock);
+ if (update)
+ err = tgt_server_data_write(info->fti_env, tg, th);
+ } else {
+ LASSERT(fed->fed_ted.ted_lr_off > 0);
+ err = tgt_client_data_write(info->fti_env, &ofd->ofd_lut, lcd,