Whamcloud - gitweb
Branch HEAD
authorhuanghua <huanghua>
Tue, 3 Mar 2009 05:43:21 +0000 (05:43 +0000)
committerhuanghua <huanghua>
Tue, 3 Mar 2009 05:43:21 +0000 (05:43 +0000)
b=11404
i=yong.fan
i=rahul.deshmukh

close old open handle in replay if needed;
some more verbose debugging info.

lustre/mdd/mdd_dir.c
lustre/mdd/mdd_object.c
lustre/mdd/mdd_orphans.c
lustre/mdt/mdt_handler.c
lustre/mdt/mdt_open.c

index 03a9e86..247b389 100644 (file)
@@ -763,8 +763,13 @@ int mdd_finish_unlink(const struct lu_env *env,
                  * will be deleted during mdd_close() */
                 if (obj->mod_count) {
                         rc = __mdd_orphan_add(env, obj, th);
-                        if (rc == 0)
+                        if (rc == 0) {
                                 obj->mod_flags |= ORPHAN_OBJ;
+                                CDEBUG(D_HA, "Object "DFID" is going to be "
+                                        "an orphan, open count = %d\n",
+                                        PFID(mdd_object_fid(obj)),
+                                        obj->mod_count);
+                        }
                 }
 
                 obj->mod_flags |= DEAD_OBJ;
index e4f917b..0a86597 100644 (file)
@@ -306,7 +306,7 @@ static int mdd_object_print(const struct lu_env *env, void *cookie,
 {
         struct mdd_object *mdd = lu2mdd_obj((struct lu_object *)o);
         return (*p)(env, cookie, LUSTRE_MDD_NAME"-object@%p(open_count=%d, "
-                    "valid=%x, cltime=%llu, flags=%lx",
+                    "valid=%x, cltime=%llu, flags=%lx)",
                     mdd, mdd->mod_count, mdd->mod_valid,
                     mdd->mod_cltime, mdd->mod_flags);
 }
index 506916e..6030725 100644 (file)
@@ -343,9 +343,10 @@ static int orph_key_test_and_del(const struct lu_env *env,
 
         rc = -EBUSY;
         if (mdo->mod_count == 0) {
-                CWARN("Found orphan!\n");
+                CWARN("Found orphan! Delete it\n");
                 rc = orphan_object_destroy(env, mdo, key);
         } else {
+                CDEBUG(D_HA, "Found orphan, open count = %d\n", mdo->mod_count);
                 mdo->mod_flags |= ORPHAN_OBJ;
         }
 
index 74cfc0e..2212bff 100644 (file)
@@ -4852,7 +4852,9 @@ static int mdt_object_print(const struct lu_env *env, void *cookie,
 {
         struct mdt_object *mdto = mdt_obj((struct lu_object *)o);
         return (*p)(env, cookie, LUSTRE_MDT_NAME"-object@%p(ioepoch=%llu "
-                   "flags=%llx)", mdto, mdto->mot_ioepoch, mdto->mot_flags);
+                    "flags=%llx, epochcount=%d, writecount=%d)",
+                    mdto, mdto->mot_ioepoch, mdto->mot_flags,
+                    mdto->mot_epochcount, mdto->mot_writecount);
 }
 
 static const struct lu_device_operations mdt_lu_ops = {
index ba2d4c2..de40195 100644 (file)
@@ -470,13 +470,16 @@ static int mdt_mfd_open(struct mdt_thread_info *info, struct mdt_object *p,
                         LASSERT(info->mti_rr.rr_handle != NULL);
                         old_mfd = mdt_handle2mfd(info, info->mti_rr.rr_handle);
                         if (old_mfd) {
-                                CDEBUG(D_HA, "del orph mfd %p cookie" LPX64"\n",
-                                       mfd, info->mti_rr.rr_handle->cookie);
+                                CDEBUG(D_HA, "del orph mfd %p fid=("DFID") "
+                                       "cookie=" LPX64"\n",
+                                       mfd, 
+                                       PFID(mdt_object_fid(mfd->mfd_object)),
+                                       info->mti_rr.rr_handle->cookie);
                                 spin_lock(&med->med_open_lock);
                                 class_handle_unhash(&old_mfd->mfd_handle);
                                 list_del_init(&old_mfd->mfd_list);
                                 spin_unlock(&med->med_open_lock);
-                                mdt_mfd_free(old_mfd);
+                                mdt_mfd_close(info, old_mfd);
                         }
                         CDEBUG(D_HA, "Store old cookie "LPX64" in new mfd\n",
                                info->mti_rr.rr_handle->cookie);