-
- /* XXX update always from reply buffer */
- rpc_lvb = req_capsule_server_get(&req->rq_pill, &RMF_DLM_LVB);
- if (rpc_lvb == NULL) {
- CERROR("lustre_swab_buf failed\n");
- goto disk_update;
+ bool lvb_type;
+
+ if (req->rq_import != NULL)
+ lvb_type = imp_connect_lvb_type(req->rq_import);
+ else
+ lvb_type = exp_connect_lvb_type(req->rq_export);
+
+ if (!lvb_type) {
+ struct ost_lvb_v1 *lvb_v1;
+
+ lvb_v1 = req_capsule_server_swab_get(&req->rq_pill,
+ &RMF_DLM_LVB, lustre_swab_ost_lvb_v1);
+ if (lvb_v1 == NULL)
+ goto disk_update;
+
+ rpc_lvb = &info->fti_lvb;
+ memcpy(rpc_lvb, lvb_v1, sizeof *lvb_v1);
+ rpc_lvb->lvb_mtime_ns = 0;
+ rpc_lvb->lvb_atime_ns = 0;
+ rpc_lvb->lvb_ctime_ns = 0;
+ } else {
+ rpc_lvb = req_capsule_server_swab_get(&req->rq_pill,
+ &RMF_DLM_LVB,
+ lustre_swab_ost_lvb);
+ if (rpc_lvb == NULL)
+ goto disk_update;