Whamcloud - gitweb
call mdd_lov_create() only for regular files and before the transaction start.
authortappro <tappro>
Thu, 13 Jul 2006 00:07:05 +0000 (00:07 +0000)
committertappro <tappro>
Thu, 13 Jul 2006 00:07:05 +0000 (00:07 +0000)
lustre/mdd/mdd_handler.c

index 7746502..20a2e50 100644 (file)
@@ -741,6 +741,15 @@ static int mdd_create(const struct lu_context *ctxt, struct md_object *pobj,
         int rc, created = 0, inserted = 0, ref_add = 0;
         ENTRY;
 
+        /* no RPC inside the transaction, so OST objects should be created at
+         * first */
+
+        if (S_ISREG(attr->la_mode)) {
+                rc = mdd_lov_create(ctxt, mdd, son);
+                if (rc)
+                        RETURN(rc);
+        }
+
         mdd_txn_param_build(ctxt, &MDD_TXN_MKDIR);
         handle = mdd_trans_start(ctxt, mdd);
         if (IS_ERR(handle))
@@ -790,9 +799,6 @@ static int mdd_create(const struct lu_context *ctxt, struct md_object *pobj,
         if (rc)
                 GOTO(cleanup, rc);
 
-        rc = mdd_lov_create(ctxt, mdd, son);
-        if (rc)
-                GOTO(cleanup, rc);
         created = 1;
         rc = __mdd_index_insert(ctxt, mdo, lu_object_fid(&child->mo_lu),
                                 name, handle);