diff --git a/lustre/mds/handler.c b/lustre/mds/handler.c index 761760dfdd3282c710e4a5ce475f84731d87f28c..4279f547c749717fc742016ccb6ab3e4e2ce4a9b 100644 --- a/lustre/mds/handler.c +++ b/lustre/mds/handler.c @@ -1171,7 +1171,6 @@ static char *reint_names[] = { static int mdt_obj_create(struct ptlrpc_request *req) { - unsigned int tmpname = ll_insecure_random_int(); struct ldlm_res_id res_id = { .name = {0} }; struct obd_export *exp = req->rq_export; struct obd_device *obd = exp->exp_obd; @@ -1184,6 +1183,7 @@ static int mdt_obj_create(struct ptlrpc_request *req) struct obd_run_ctxt saved; ldlm_policy_data_t policy; int mealen, flags = 0; + unsigned int tmpname; struct obd_ucred uc; struct dentry *new; struct mea *mea; @@ -1207,12 +1207,22 @@ static int mdt_obj_create(struct ptlrpc_request *req) repbody = lustre_msg_buf(req->rq_repmsg, 0, sizeof(*repbody)); +repeat: handle = fsfilt_start(obd, parent_inode, FSFILT_OP_MKDIR, NULL); LASSERT(!IS_ERR(handle)); + tmpname = ll_insecure_random_int(); sprintf(fidname, "%u", tmpname); new = simple_mkdir(mds->mds_objects_dir, fidname, body->oa.o_mode, 1); + if (IS_ERR(new)) { + CERROR("%s: can't create new inode %s) for mkdir: %d\n", + obd->obd_name, fidname, (int) PTR_ERR(new)); + if (PTR_ERR(new) == -EEXIST) { + fsfilt_commit(obd, parent_inode, handle, 0); + goto repeat; + } + } LASSERT(!IS_ERR(new)); LASSERT(new->d_inode != NULL); diff --git a/lustre/mds/mds_lmv.c b/lustre/mds/mds_lmv.c index c4ea3af242053938e5996def6ec7396e79885d50..d61a0f31918be0eb18a73de8e3719ee457d4a61e 100644 --- a/lustre/mds/mds_lmv.c +++ b/lustre/mds/mds_lmv.c @@ -618,7 +618,7 @@ int mds_commitrw(int cmd, struct obd_export *exp, struct obdo *oa, for (i = 0, lnb = res; i < obj->ioo_bufcnt; i++, lnb++) __free_page(lnb->page); - f_dput(res->dentry); + l_dput(res->dentry); RETURN(rc); } diff --git a/lustre/mds/mds_reint.c b/lustre/mds/mds_reint.c index bb5633498a3fda298f9372c3fc0749638dffd28d..24c249fc4b480f405a541c3e0923f8d8e6b0cce9 100644 --- a/lustre/mds/mds_reint.c +++ b/lustre/mds/mds_reint.c @@ -1314,7 +1314,7 @@ int mds_create_local_dentry(struct mds_update_record *rec, if (new_child->d_inode != NULL) { /* nice. we've already have local dentry! */ - CERROR("found dentry in FIDS/: %u/%u\n", + CDEBUG(D_OTHER, "found dentry in FIDS/: %u/%u\n", (unsigned) new_child->d_inode->i_ino, (unsigned) new_child->d_inode->i_generation); rec->ur_fid1->id = fids_dir->i_ino;