void *caller_data = NULL;
struct osc_async_page *oap;
struct ldlm_lock *lock = NULL;
+ obd_valid valid;
int i, rc;
ENTRY;
CERROR("prep_req failed: %d\n", rc);
GOTO(out, req = ERR_PTR(rc));
}
+ oa = &((struct ost_body *)lustre_msg_buf(req->rq_reqmsg, REQ_REC_OFF,
+ sizeof(struct ost_body)))->oa;
/* Need to update the timestamps after the request is built in case
* we race with setattr (locally or in queue at OST). If OST gets
* later setattr before earlier BRW (as determined by the request xid),
* the OST will not use BRW timestamps. Sadly, there is no obvious
* way to do this in a single call. bug 10150 */
- ops->ap_update_obdo(caller_data, cmd, oa,
- OBD_MD_FLMTIME | OBD_MD_FLCTIME | OBD_MD_FLATIME);
+ if (pga[0]->flag & OBD_BRW_SRVLOCK) {
+ /* in case of lockless read/write do not use inode's
+ * timestamps because concurrent stat might fill the
+ * inode with out-of-date times, send current
+ * instead */
+ if (cmd & OBD_BRW_WRITE) {
+ oa->o_mtime = oa->o_ctime = LTIME_S(CURRENT_TIME);
+ oa->o_valid |= OBD_MD_FLMTIME | OBD_MD_FLCTIME;
+ valid = OBD_MD_FLATIME;
+ } else {
+ oa->o_atime = LTIME_S(CURRENT_TIME);
+ oa->o_valid |= OBD_MD_FLATIME;
+ valid = OBD_MD_FLMTIME | OBD_MD_FLCTIME;
+ }
+ } else {
+ valid = OBD_MD_FLMTIME | OBD_MD_FLCTIME | OBD_MD_FLATIME;
+ }
+ ops->ap_update_obdo(caller_data, cmd, oa, valid);
CLASSERT(sizeof(*aa) <= sizeof(req->rq_async_args));
aa = ptlrpc_req_async_args(req);