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.
Use ofd_write_lock() to protect fmd lookup/udpate in
ofd_punch_object(), otherwise, it could race with ofd_attr_set()
and ofd_commitrw().
Signed-off-by: Niu Yawei <yawei.niu@intel.com>
Change-Id: I16216038ea2bd064ef7f33857a1d4aba167ac5fb
Reviewed-on: http://review.whamcloud.com/12865
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Bobi Jam <bobijam@gmail.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
/* we support truncate, not punch yet */
LASSERT(end == OBD_OBJECT_EOF);
+ ofd_write_lock(env, fo);
fmd = ofd_fmd_get(info->fti_exp, &fo->ofo_header.loh_fid);
if (fmd && fmd->fmd_mactime_xid < info->fti_xid)
fmd->fmd_mactime_xid = info->fti_xid;
ofd_fmd_put(info->fti_exp, fmd);
- ofd_write_lock(env, fo);
if (!ofd_object_exists(fo))
GOTO(unlock, rc = -ENOENT);
int i;
int rc;
struct list_head rpc_list = LIST_HEAD_INIT(rpc_list);
-
+ struct ost_body *body;
ENTRY;
LASSERT(!list_empty(ext_list));
* 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);