.do_object_lock = osp_md_object_lock,
.do_object_unlock = osp_md_object_unlock,
.do_invalidate = osp_invalidate,
+ .do_check_stale = osp_check_stale,
};
/**
return 0;
}
+static int osp_write_interpreter(const struct lu_env *env,
+ struct object_update_reply *reply,
+ struct ptlrpc_request *req,
+ struct osp_object *obj,
+ void *data, int index, int rc)
+{
+ if (rc) {
+ CDEBUG(D_HA, "error "DFID": rc = %d\n",
+ PFID(lu_object_fid(&obj->opo_obj.do_lu)), rc);
+ spin_lock(&obj->opo_lock);
+ obj->opo_attr.la_valid = 0;
+ obj->opo_stale = 1;
+ spin_unlock(&obj->opo_lock);
+ }
+ return 0;
+}
+
/**
* Implementation of dt_body_operations::dbo_write
*
if (rc < 0)
RETURN(rc);
+ /* to be able to invalidate object's state in case of an error */
+ rc = osp_insert_update_callback(env, update, obj, NULL,
+ osp_write_interpreter);
+ if (rc < 0)
+ RETURN(rc);
+
/* XXX: how about the write error happened later? */
*pos += buf->lb_len;
/* allocate bulk descriptor */
desc = ptlrpc_prep_bulk_imp(req, pages, 1,
- PTLRPC_BULK_PUT_SINK | PTLRPC_BULK_BUF_KIOV,
+ PTLRPC_BULK_PUT_SINK,
MDS_BULK_PORTAL,
&ptlrpc_bulk_kiov_nopin_ops);
if (desc == NULL)