Whamcloud - gitweb
LU-3544 fid: do open-by-fid by default
[fs/lustre-release.git] / lustre / mdc / mdc_locks.c
index da658b5..2d3d171 100644 (file)
@@ -189,7 +189,7 @@ int mdc_null_inode(struct obd_export *exp,
        fid_build_reg_res_name(fid, &res_id);
 
        res = ldlm_resource_get(ns, NULL, &res_id, 0, 0);
-       if(res == NULL)
+       if (IS_ERR(res))
                RETURN(0);
 
        lock_res(res);
@@ -898,9 +898,8 @@ resend:
        mdc_put_rpc_lock(obddev->u.cli.cl_rpc_lock, it);
 
        if (rc < 0) {
-               CDEBUG_LIMIT((rc == -EACCES || rc == -EIDRM) ? D_INFO : D_ERROR,
-                            "%s: ldlm_cli_enqueue failed: rc = %d\n",
-                            obddev->obd_name, rc);
+               CDEBUG(D_INFO, "%s: ldlm_cli_enqueue failed: rc = %d\n",
+                      obddev->obd_name, rc);
 
                mdc_clear_replay_flag(req, rc);
                ptlrpc_req_finished(req);
@@ -976,26 +975,6 @@ static int mdc_finish_intent_lock(struct obd_export *exp,
         mdt_body = req_capsule_server_get(&request->rq_pill, &RMF_MDT_BODY);
         LASSERT(mdt_body != NULL);      /* mdc_enqueue checked */
 
-        /* If we were revalidating a fid/name pair, mark the intent in
-         * case we fail and get called again from lookup */
-        if (fid_is_sane(&op_data->op_fid2) &&
-            it->it_create_mode & M_CHECK_STALE &&
-            it->it_op != IT_GETATTR) {
-                /* Also: did we find the same inode? */
-                /* sever can return one of two fids:
-                 * op_fid2 - new allocated fid - if file is created.
-                 * op_fid3 - existent fid - if file only open.
-                 * op_fid3 is saved in lmv_intent_open */
-               if ((!lu_fid_eq(&op_data->op_fid2, &mdt_body->mbo_fid1)) &&
-                   (!lu_fid_eq(&op_data->op_fid3, &mdt_body->mbo_fid1))) {
-                       CDEBUG(D_DENTRY, "Found stale data "DFID"("DFID")/"DFID
-                              "\n", PFID(&op_data->op_fid2),
-                              PFID(&op_data->op_fid2),
-                              PFID(&mdt_body->mbo_fid1));
-                        RETURN(-ESTALE);
-                }
-        }
-
         rc = it_open_error(DISP_LOOKUP_EXECD, it);
         if (rc)
                 RETURN(rc);