staging/lustre: update timestamps after buiding rpc
The mtime/atime/ctime in the write RPC has to be updated after the RPC is built (where xid is generated), otherwise, it could race with the setattr and updating wrong timestamps on OST side. Seems this regression was introduced when landing clio code. Signed-off-by: Niu Yawei <yawei.niu@intel.com> Reviewed-on: http://review.whamcloud.com/13261 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5951 Reviewed-by: John L. Hammond <john.hammond@intel.com> Signed-off-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>hifive-unleashed-5.1
parent
a915ffda19
commit
3ce08cd7a2
|
@ -1880,6 +1880,7 @@ int osc_build_rpc(const struct lu_env *env, struct client_obd *cli,
|
|||
int page_count = 0;
|
||||
int i;
|
||||
int rc;
|
||||
struct ost_body *body;
|
||||
LIST_HEAD(rpc_list);
|
||||
|
||||
LASSERT(!list_empty(ext_list));
|
||||
|
@ -1981,6 +1982,8 @@ int osc_build_rpc(const struct lu_env *env, struct client_obd *cli,
|
|||
* 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 */
|
||||
body = req_capsule_client_get(&req->rq_pill, &RMF_OST_BODY);
|
||||
crattr->cra_oa = &body->oa;
|
||||
cl_req_attr_set(env, clerq, crattr,
|
||||
OBD_MD_FLMTIME|OBD_MD_FLCTIME|OBD_MD_FLATIME);
|
||||
|
||||
|
|
Loading…
Reference in New Issue