From: wangdi Date: Tue, 8 Aug 2006 08:01:43 +0000 (+0000) Subject: Branch: b_new_cmd X-Git-Tag: v1_8_0_110~486^2~1234 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=e595a696fc813390255cc933c9f5881e0cf2cc14;p=fs%2Flustre-release.git Branch: b_new_cmd add index_ops check before empty dir check in mdd_unlink --- diff --git a/lustre/mdd/mdd_handler.c b/lustre/mdd/mdd_handler.c index 3cff6f5..8bc517e 100644 --- a/lustre/mdd/mdd_handler.c +++ b/lustre/mdd/mdd_handler.c @@ -755,6 +755,7 @@ static int mdd_unlink(const struct lu_context *ctxt, struct md_object *pobj, struct mdd_device *mdd = mdo2mdd(pobj); struct mdd_object *mdd_pobj = md2mdd_obj(pobj); struct mdd_object *mdd_cobj = md2mdd_obj(cobj); + struct dt_object *dt_cobj = mdd_object_child(mdd_cobj); struct thandle *handle; int rc; ENTRY; @@ -773,7 +774,8 @@ static int mdd_unlink(const struct lu_context *ctxt, struct md_object *pobj, mdd_lock2(ctxt, mdd_pobj, mdd_cobj); /* rmdir checks */ - if (S_ISDIR(lu_object_attr(&cobj->mo_lu))) { + if (S_ISDIR(lu_object_attr(&cobj->mo_lu)) && + dt_try_as_dir(ctxt, dt_cobj)) { rc = mdd_dir_is_empty(ctxt, mdd_cobj); if (rc != 0) GOTO(cleanup, rc);