[PVFS2-CVS] commit by neill in pvfs2/src/server: crdirent.sm

CVS commit program cvs at parl.clemson.edu
Thu Jul 29 13:31:25 EDT 2004


Update of /projects/cvsroot/pvfs2/src/server
In directory parlweb:/tmp/cvs-serv13098/src/server

Modified Files:
	crdirent.sm 
Log Message:
- enforce a handle allocation of the (hidden/internal) dspace created on the
  server side during a crdirent to be within the metadata range that the server
  is managing.  this is a bugfix to bad behaviour that allowed metadata to
  live in the data handle ranges all this time


Index: crdirent.sm
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/server/crdirent.sm,v
diff -p -u -r1.40 -r1.41
--- crdirent.sm	28 Jul 2004 14:32:55 -0000	1.40
+++ crdirent.sm	29 Jul 2004 16:31:25 -0000	1.41
@@ -266,9 +266,8 @@ static int crdirent_read_directory_entry
 static int crdirent_create_dirdata_dspace(PINT_server_op *s_op,
 					  job_status_s* js_p)
 {
-    int ret;
+    int ret = -PVFS_ENOMEM;
     job_id_t i;
-    PVFS_handle_extent extent;
     PVFS_handle_extent_array extent_array;
     struct server_configuration_s *user_opts = get_server_config_struct();
 
@@ -278,10 +277,16 @@ static int crdirent_create_dirdata_dspac
         GOSSIP_SERVER_DEBUG, "  creating dspace (coll_id = %d)\n",
         s_op->u.crdirent.fs_id);
 
-    /* FIXME: arbitrary handle here, or honor a range? */
-    extent.first = extent.last = 0;
-    extent_array.extent_count = 1;
-    extent_array.extent_array = &extent;
+    /* find our meta handle range for this create */
+    ret = PINT_config_get_meta_handle_extent_array(
+        user_opts, s_op->u.crdirent.fs_id, &extent_array);
+    assert(ret == 0);
+    assert(extent_array.extent_count > 0);
+
+    gossip_debug(GOSSIP_SERVER_DEBUG, "  new handle should be in range "
+                 "starting with %Lu-%Lu\n",
+                 extent_array.extent_array[0].first,
+                 extent_array.extent_array[0].last);
 
     ret = job_trove_dspace_create(
         s_op->u.crdirent.fs_id,
@@ -295,6 +300,9 @@ static int crdirent_create_dirdata_dspac
         js_p,
         &i,
         server_job_context);
+
+    free(extent_array.extent_array);
+    extent_array.extent_array = NULL;
 
     return ret;
 }



More information about the PVFS2-CVS mailing list