Whamcloud - gitweb
Introduce .gitignore files.
[fs/lustre-release.git] / lustre / mdt / mdt_open.c
index e2bea57..f98b7a7 100644 (file)
@@ -343,7 +343,7 @@ static void mdt_empty_transno(struct mdt_thread_info* info)
         struct ptlrpc_request *req = mdt_info_req(info);
 
         ENTRY;
-        /* transaction is occured already */
+        /* transaction has occurred already */
         if (lustre_msg_get_transno(req->rq_repmsg) != 0) {
                 EXIT;
                 return;
@@ -365,7 +365,6 @@ static void mdt_empty_transno(struct mdt_thread_info* info)
 
         req->rq_transno = info->mti_transno;
         lustre_msg_set_transno(req->rq_repmsg, info->mti_transno);
-        lustre_msg_set_last_xid(req->rq_repmsg, req->rq_xid);
         EXIT;
 }
 
@@ -486,11 +485,20 @@ static int mdt_mfd_open(struct mdt_thread_info *info, struct mdt_object *p,
                         mfd->mfd_old_handle.cookie =
                                                 info->mti_rr.rr_handle->cookie;
                 }
-                spin_lock(&med->med_open_lock);
-                list_add(&mfd->mfd_list, &med->med_open_head);
-                spin_unlock(&med->med_open_lock);
-
                 repbody->handle.cookie = mfd->mfd_handle.h_cookie;
+
+                if (req->rq_export->exp_disconnected) {
+                        spin_lock(&med->med_open_lock);
+                        class_handle_unhash(&mfd->mfd_handle);
+                        list_del_init(&mfd->mfd_list);
+                        spin_unlock(&med->med_open_lock);
+                        mdt_mfd_close(info, mfd);
+                } else {
+                        spin_lock(&med->med_open_lock);
+                        list_add(&mfd->mfd_list, &med->med_open_head);
+                        spin_unlock(&med->med_open_lock);
+                }
+
                 mdt_empty_transno(info);
         } else
                 rc = -ENOMEM;
@@ -729,6 +737,7 @@ void mdt_reconstruct_open(struct mdt_thread_info *info,
                                       PFID(mdt_object_fid(child)), rc,
                                       obd_uuid2str(&exp->exp_client_uuid),
                                       obd_export_nid2str(exp));
+                        mdt_object_put(env, parent);
                         mdt_export_evict(exp);
                         EXIT;
                         return;
@@ -961,9 +970,8 @@ int mdt_reint_open(struct mdt_thread_info *info, struct mdt_lock_handle *lhc)
         LASSERT(info->mti_pill->rc_fmt == &RQF_LDLM_INTENT_OPEN);
         ldlm_rep = req_capsule_server_get(info->mti_pill, &RMF_DLM_REP);
 
-        /* JOIN file was deprecated since 1.6.5, but may be revived one day */
-        if (create_flags & MDS_OPEN_JOIN_FILE) {
-                CERROR("file join is unsupported in this version of Lustre\n");
+        if (unlikely(create_flags & MDS_OPEN_JOIN_FILE)) {
+                CERROR("file join is not supported anymore.\n");
                 GOTO(out, result = err_serious(-EOPNOTSUPP));
         }
         msg_flags = lustre_msg_get_flags(req->rq_reqmsg);
@@ -1348,7 +1356,8 @@ int mdt_close(struct mdt_thread_info *info)
                 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);