From: huanghua Date: Tue, 3 Mar 2009 05:43:21 +0000 (+0000) Subject: Branch HEAD X-Git-Tag: v1_9_164~42 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=244395a973d00367a919aabf2094b7ccea6456b6;p=fs%2Flustre-release.git Branch HEAD b=11404 i=yong.fan i=rahul.deshmukh close old open handle in replay if needed; some more verbose debugging info. --- diff --git a/lustre/mdd/mdd_dir.c b/lustre/mdd/mdd_dir.c index 03a9e86..247b389 100644 --- a/lustre/mdd/mdd_dir.c +++ b/lustre/mdd/mdd_dir.c @@ -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; diff --git a/lustre/mdd/mdd_object.c b/lustre/mdd/mdd_object.c index e4f917b..0a86597 100644 --- a/lustre/mdd/mdd_object.c +++ b/lustre/mdd/mdd_object.c @@ -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); } diff --git a/lustre/mdd/mdd_orphans.c b/lustre/mdd/mdd_orphans.c index 506916e..6030725 100644 --- a/lustre/mdd/mdd_orphans.c +++ b/lustre/mdd/mdd_orphans.c @@ -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; } diff --git a/lustre/mdt/mdt_handler.c b/lustre/mdt/mdt_handler.c index 74cfc0e..2212bff 100644 --- a/lustre/mdt/mdt_handler.c +++ b/lustre/mdt/mdt_handler.c @@ -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 = { diff --git a/lustre/mdt/mdt_open.c b/lustre/mdt/mdt_open.c index ba2d4c2..de40195 100644 --- a/lustre/mdt/mdt_open.c +++ b/lustre/mdt/mdt_open.c @@ -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);