Whamcloud - gitweb
LU-7809 lod: stop recovery before destory dtrq list
[fs/lustre-release.git] / lustre / mdt / mdt_handler.c
index 437b7da..422c5c3 100644 (file)
@@ -1105,7 +1105,7 @@ static int mdt_getattr_internal(struct mdt_thread_info *info,
                               PFID(mdt_object_fid(o)), rc);
                        rc = -EFAULT;
                } else {
-                       int print_limit = min_t(int, PAGE_CACHE_SIZE - 128, rc);
+                       int print_limit = min_t(int, PAGE_SIZE - 128, rc);
 
                        if (OBD_FAIL_CHECK(OBD_FAIL_MDS_READLINK_EPROTO))
                                rc -= 2;
@@ -1785,8 +1785,8 @@ static int mdt_readpage(struct tgt_session_info *tsi)
                rdpg->rp_attrs |= LUDA_64BITHASH;
        rdpg->rp_count  = min_t(unsigned int, reqbody->mbo_nlink,
                                exp_max_brw_size(tsi->tsi_exp));
-       rdpg->rp_npages = (rdpg->rp_count + PAGE_CACHE_SIZE - 1) >>
-                         PAGE_CACHE_SHIFT;
+       rdpg->rp_npages = (rdpg->rp_count + PAGE_SIZE - 1) >>
+                         PAGE_SHIFT;
         OBD_ALLOC(rdpg->rp_pages, rdpg->rp_npages * sizeof rdpg->rp_pages[0]);
         if (rdpg->rp_pages == NULL)
                 RETURN(-ENOMEM);
@@ -3309,7 +3309,8 @@ static int mdt_intent_getxattr(enum mdt_it_code opcode,
 {
        struct mdt_lock_handle *lhc = &info->mti_lh[MDT_LH_RMT];
        struct ldlm_reply      *ldlm_rep = NULL;
-       int rc, grc;
+       int rc;
+       ENTRY;
 
        /*
         * Initialize lhc->mlh_reg_lh either from a previously granted lock
@@ -3325,18 +3326,30 @@ static int mdt_intent_getxattr(enum mdt_it_code opcode,
                        return rc;
        }
 
-       grc = mdt_getxattr(info);
-
-       rc = mdt_intent_lock_replace(info, lockp, lhc, flags, 0);
+       rc = mdt_getxattr(info);
 
        if (mdt_info_req(info)->rq_repmsg != NULL)
                ldlm_rep = req_capsule_server_get(info->mti_pill, &RMF_DLM_REP);
-       if (ldlm_rep == NULL)
+
+       if (ldlm_rep == NULL ||
+           OBD_FAIL_CHECK(OBD_FAIL_MDS_XATTR_REP)) {
+               mdt_object_unlock(info,  info->mti_object, lhc, 1);
                RETURN(err_serious(-EFAULT));
+       }
+
+       ldlm_rep->lock_policy_res2 = clear_serious(rc);
 
-       ldlm_rep->lock_policy_res2 = grc;
+       /* This is left for interop instead of adding a new interop flag.
+        * LU-7433 */
+#if LUSTRE_VERSION_CODE > OBD_OCD_VERSION(3, 0, 0, 0)
+       if (ldlm_rep->lock_policy_res2) {
+               mdt_object_unlock(info, info->mti_object, lhc, 1);
+               RETURN(ELDLM_LOCK_ABORTED);
+       }
+#endif
 
-       return rc;
+       rc = mdt_intent_lock_replace(info, lockp, lhc, flags, rc);
+       RETURN(rc);
 }
 
 static int mdt_intent_getattr(enum mdt_it_code opcode,
@@ -4508,7 +4521,6 @@ static void mdt_fini(const struct lu_env *env, struct mdt_device *m)
        next->md_ops->mdo_iocontrol(env, next, OBD_IOC_STOP_LFSCK, 0, &stop);
 
        mdt_stack_pre_fini(env, m, md2lu_dev(m->mdt_child));
-       target_recovery_fini(obd);
        ping_evictor_stop();
 
        if (m->mdt_opts.mo_coordinator)