if (op_data->op_attr.ia_valid & (ATTR_MTIME | ATTR_CTIME))
CDEBUG(D_INODE, "setting mtime "CFS_TIME_T
- ", ctime "CFS_TIME_T"\n",
+ ", ctime "CFS_TIME_T"\n",
LTIME_S(op_data->op_attr.ia_mtime),
LTIME_S(op_data->op_attr.ia_ctime));
mdc_setattr_pack(req, op_data, ea, ealen, ea2, ea2len);
epoch->handle = body->handle;
epoch->ioepoch = body->ioepoch;
req->rq_replay_cb = mdc_replay_open;
+ /** bug 3633, open may be committed and estale answer is not error */
+ } else if (rc == -ESTALE && (op_data->op_flags & MF_SOM_CHANGE)) {
+ rc = 0;
+ } else if (rc == -ERESTARTSYS) {
+ rc = 0;
}
*request = req;
- if (rc == -ERESTARTSYS)
- rc = 0;
if (rc && req->rq_commit_cb)
req->rq_commit_cb(req);
RETURN(rc);
body = req_capsule_server_get(&req->rq_pill, &RMF_MDT_BODY);
if (body == NULL)
rc = -EPROTO;
+ } else if (rc == -ESTALE) {
+ /**
+ * it can be allowed error after 3633 if open was committed and
+ * server failed before close was sent. Let's check if mod
+ * exists and return no error in that case
+ */
+ if (mod && (mod->mod_open_req == NULL))
+ rc = 0;
}
if (rc != 0 && mod)
mod->mod_close_req = req;
DEBUG_REQ(D_HA, mod->mod_open_req, "matched setattr");
- /* We no longer want to preserve this open for replay even
+ /* We no longer want to preserve this setattr for replay even
* though the open was committed. b=3632, b=3633 */
spin_lock(&mod->mod_open_req->rq_lock);
mod->mod_open_req->rq_replay = 0;
rc = ptlrpc_queue_wait(req);
mdc_put_rpc_lock(obd->u.cli.cl_close_lock, NULL);
+ if (rc == -ESTALE) {
+ /**
+ * it can be allowed error after 3633 if open or setattr were
+ * committed and server failed before close was sent.
+ * Let's check if mod exists and return no error in that case
+ */
+ if (mod && (mod->mod_open_req == NULL))
+ rc = 0;
+ }
+
ptlrpc_req_finished(req);
RETURN(rc);
}
CDEBUG(D_INODE, "no handle for file close: fid = "DFID
": cookie = "LPX64"\n", PFID(info->mti_rr.rr_fid1),
info->mti_epoch->handle.cookie);
- rc = err_serious(-ESTALE);
+ /** not serious error since bug 3633 */
+ rc = -ESTALE;
} else {
class_handle_unhash(&mfd->mfd_handle);
list_del_init(&mfd->mfd_list);