struct mdt_epoch *epoch;
rec = lustre_msg_buf(req->rq_reqmsg, offset, sizeof (*rec));
- epoch = lustre_msg_buf(req->rq_reqmsg, offset + 1, sizeof(*epoch));
mdc_setattr_pack_rec(rec, op_data);
- if (epoch)
+
+ if (op_data->flags & (MF_SOM_CHANGE | MF_EPOCH_OPEN)) {
+ epoch = lustre_msg_buf(req->rq_reqmsg, offset + 1,
+ sizeof(*epoch));
mdc_epoch_pack(epoch, op_data);
+ }
if (ealen == 0)
return;
struct req_capsule *pill = &info->mti_pill;
ENTRY;
- info->mti_epoch = req_capsule_client_get(pill, &RMF_MDT_EPOCH);
+ if (req_capsule_get_size(pill, &RMF_MDT_EPOCH, RCL_CLIENT))
+ info->mti_epoch = req_capsule_client_get(pill, &RMF_MDT_EPOCH);
+ else
+ /* it is set to NULL already.
+ info->mti_epoch = NULL;
+ */
+ ;
RETURN(info->mti_epoch == NULL ? -EFAULT : 0);
}
if (rc)
RETURN(rc);
- /* Epoch may be absent, skip errors. */
+ /* Epoch may be absent */
mdt_epoch_unpack(info);
if (req_capsule_field_present(pill, &RMF_EADATA, RCL_CLIENT)) {