From e595a696fc813390255cc933c9f5881e0cf2cc14 Mon Sep 17 00:00:00 2001 From: wangdi Date: Tue, 8 Aug 2006 08:01:43 +0000 Subject: [PATCH] Branch: b_new_cmd add index_ops check before empty dir check in mdd_unlink --- lustre/mdd/mdd_handler.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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); -- 1.8.3.1