[PVFS2-CVS] commit by robl in pvfs2-1/src/server: pvfs2-server.c

CVS commit program cvs at parl.clemson.edu
Tue Nov 8 11:29:25 EST 2005


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

Modified Files:
	pvfs2-server.c 
Log Message:
[pcarns]: Added safety check and verbose error message for case in which server
is started with a configuration file that does not match the storage space (in
particular, if the fsid's do not match)


Index: pvfs2-server.c
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/src/server/pvfs2-server.c,v
diff -u -w -p -u -r1.193 -r1.194
--- pvfs2-server.c	27 Oct 2005 18:43:11 -0000	1.193
+++ pvfs2-server.c	8 Nov 2005 16:29:24 -0000	1.194
@@ -824,6 +824,7 @@ static int server_initialize_subsystems(
     struct filesystem_configuration_s *cur_fs;
     TROVE_context_id trove_context = -1;
     char buf[16] = {0};
+    PVFS_fs_id orig_fsid;
 
     /* Initialize distributions */
     ret = PINT_dist_initialize(0);
@@ -919,6 +920,7 @@ static int server_initialize_subsystems(
             return(ret);
         }
 
+        orig_fsid = cur_fs->coll_id;
         ret = trove_collection_lookup(
             cur_fs->file_system_name, &(cur_fs->coll_id), NULL, NULL);
 
@@ -927,6 +929,17 @@ static int server_initialize_subsystems(
             gossip_lerr("Error initializing filesystem %s\n",
                         cur_fs->file_system_name);
             return ret;
+        }
+
+        if(orig_fsid != cur_fs->coll_id)
+        {
+            gossip_err("Error: configuration file does not match storage collection.\n");
+            gossip_err("   config file fs_id: %d\n", (int)orig_fsid);
+            gossip_err("   storage fs_id: %d\n", (int)cur_fs->coll_id);
+            gossip_err("Warning: This most likely means that the configuration\n");
+            gossip_err("   files have been regenerated without destroying and\n");
+            gossip_err("   recreating the corresponding storage collection.\n");
+            return(-PVFS_ENODEV);
         }
 
         /*



More information about the PVFS2-CVS mailing list