[Pvfs2-cvs] commit by slang in pvfs2/src/common/misc: errno-mapping.c msgpairarray.sm pint-util.c pvfs2-util.c server-config-mgr.c server-config-mgr.h

CVS commit program cvs at parl.clemson.edu
Thu Apr 5 11:49:38 EDT 2007


Update of /projects/cvsroot/pvfs2/src/common/misc
In directory parlweb1:/tmp/cvs-serv2726/src/common/misc

Modified Files:
      Tag: pvfs-2-6-branch
	errno-mapping.c msgpairarray.sm pint-util.c pvfs2-util.c 
	server-config-mgr.c server-config-mgr.h 
Log Message:
merge recent fixes from HEAD


Index: errno-mapping.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/common/misc/errno-mapping.c,v
diff -p -u -r1.15 -r1.15.26.1
--- errno-mapping.c	29 May 2006 16:21:11 -0000	1.15
+++ errno-mapping.c	5 Apr 2007 15:49:38 -0000	1.15.26.1
@@ -62,18 +62,19 @@ void PVFS_perror(const char *text, int r
         char buf[MAX_PVFS_STRERROR_LEN] = {0};
         int index = PVFS_get_errno_mapping(-retcode);
 
-        snprintf(buf,MAX_PVFS_STRERROR_LEN,"%s: %s\n",text,
-                 PINT_non_errno_strerror_mapping[index]);
+        snprintf(buf,MAX_PVFS_STRERROR_LEN,"%s: %s (error class: %d)\n",text,
+                 PINT_non_errno_strerror_mapping[index], PVFS_ERROR_CLASS(-retcode));
         fprintf(stderr, "%s", buf);
     }
     else if (IS_PVFS_ERROR(-retcode))
     {
-	fprintf(stderr, "%s: %s\n", text,
-	strerror(PVFS_ERROR_TO_ERRNO(-retcode)));
+	fprintf(stderr, "%s: %s (error class: %d)\n", text,
+	strerror(PVFS_ERROR_TO_ERRNO(-retcode)),
+        PVFS_ERROR_CLASS(-retcode));
     }
     else
     {
-	fprintf(stderr, "Warning: non PVFS2 error code (%x):\n",
+	fprintf(stderr, "Warning: non PVFS2 error code (%d):\n",
                 -retcode);
 	fprintf(stderr, "%s: %s\n", text, strerror(-retcode));
     }
@@ -103,7 +104,7 @@ void PVFS_perror_gossip(const char *text
     }
     else
     {
-	gossip_err("Warning: non PVFS2 error code (%x):\n", -retcode);
+	gossip_err("Warning: non PVFS2 error code (%d):\n", -retcode);
 	gossip_err("%s: %s\n", text, strerror(-retcode));
     }
     return;

Index: msgpairarray.sm
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/common/misc/msgpairarray.sm,v
diff -p -u -r1.37.10.1 -r1.37.10.2
--- msgpairarray.sm	13 Dec 2006 19:54:00 -0000	1.37.10.1
+++ msgpairarray.sm	5 Apr 2007 15:49:38 -0000	1.37.10.2
@@ -47,7 +47,8 @@
 enum
 {
     MSGPAIRS_COMPLETE = 190,
-    MSGPAIRS_RETRY = 191
+    MSGPAIRS_RETRY = 191,
+    MSGPAIRS_RETRY_NODELAY = 192
 };
 
 static int msgpairarray_init(
@@ -100,6 +101,7 @@ nested machine pvfs2_msgpairarray_sm(
     {
         run msgpairarray_completion_fn;
         MSGPAIRS_RETRY => post_retry;
+        MSGPAIRS_RETRY_NODELAY => post;
         default => return;
     }
 }
@@ -626,7 +628,21 @@ static int msgpairarray_completion_fn(PA
                 gossip_debug(GOSSIP_MSGPAIR_DEBUG,
                   "*** %s: msgpair %d failed, retry %d\n",
                   __func__, i, msg_p->retry_count);
-                js_p->error_code = MSGPAIRS_RETRY;
+                if(msg_p->op_status == -BMI_ECANCEL)
+                {
+                    /* if the error code indicates cancel, then skip the
+                     * delay.  We have probably already been waiting a while
+                     */
+                    gossip_debug(GOSSIP_MSGPAIR_DEBUG,
+                       "*** %s: msgpair skipping retry delay.\n", __func__);
+                    js_p->error_code = MSGPAIRS_RETRY_NODELAY;
+                }
+                else
+                {
+                    gossip_debug(GOSSIP_MSGPAIR_DEBUG,
+                       "*** %s: msgpair retrying after delay.\n", __func__);
+                    js_p->error_code = MSGPAIRS_RETRY;
+                }
 
             } else {
                 char s[1024];

Index: pint-util.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/common/misc/pint-util.c,v
diff -p -u -r1.16.8.3 -r1.16.8.4
--- pint-util.c	14 Dec 2006 05:23:55 -0000	1.16.8.3
+++ pint-util.c	5 Apr 2007 15:49:38 -0000	1.16.8.4
@@ -522,14 +522,18 @@ static int PINT_check_group(uid_t uid, g
     ret = getpwuid_r(uid, &pwd, check_group_pw_buffer,
         check_group_pw_buffer_size,
         &pwd_p);
-    if(ret != 0)
+    if(ret != 0 || pwd_p == NULL)
     {
         gen_mutex_unlock(&check_group_mutex);
         return(-PVFS_EINVAL);
     }
 
     /* check primary group */
-    if(pwd.pw_gid == gid) return 0;
+    if(pwd.pw_gid == gid)
+    {
+        gen_mutex_unlock(&check_group_mutex);
+        return 0;
+    }
 
     /* get other group information */
     ret = getgrgid_r(gid, &grp, check_group_gr_buffer,
@@ -549,9 +553,6 @@ static int PINT_check_group(uid_t uid, g
         return(-PVFS_EACCES);
     }
 
-    gen_mutex_unlock(&check_group_mutex);
-
-
     for(i = 0; grp.gr_mem[i] != NULL; i++)
     {
         if(0 == strcmp(pwd.pw_name, grp.gr_mem[i]) )
@@ -605,7 +606,14 @@ int PINT_check_acls(void *acl_buf, size_
         uid, gid, want);
 
     assert(acl_buf);
-    assert(acl_size % sizeof(pvfs2_acl_entry) == 0);
+    /* if the acl format doesn't look valid, then return an error rather than
+     * asserting; we don't want the server to crash due to an invalid keyval
+     */
+    if((acl_size % sizeof(pvfs2_acl_entry)) != 0)
+    {
+        gossip_debug(GOSSIP_PERMISSIONS_DEBUG, "invalid acls on object\n");
+        return(-PVFS_EACCES);
+    }
     count = acl_size / sizeof(pvfs2_acl_entry);
 
     for (i = 0; i < count; i++)

Index: pvfs2-util.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/common/misc/pvfs2-util.c,v
diff -p -u -r1.95 -r1.95.8.1
--- pvfs2-util.c	26 Sep 2006 03:44:17 -0000	1.95
+++ pvfs2-util.c	5 Apr 2007 15:49:38 -0000	1.95.8.1
@@ -851,6 +851,7 @@ int PVFS_util_remove_internal_mntent(
                 }
                 PVFS_util_copy_mntent(
                     &tmp_mnt_array[new_count++], current_mnt);
+                PVFS_util_free_mntent(current_mnt);
             }
 
             /* finally, swap the mntent arrays */

Index: server-config-mgr.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/common/misc/server-config-mgr.c,v
diff -p -u -r1.15 -r1.15.20.1
--- server-config-mgr.c	18 Aug 2006 21:23:46 -0000	1.15
+++ server-config-mgr.c	5 Apr 2007 15:49:38 -0000	1.15.20.1
@@ -221,12 +221,15 @@ int PINT_server_config_mgr_reload_cached
 
 int PINT_server_config_mgr_add_config(
     struct server_configuration_s *config_s,
-    PVFS_fs_id fs_id)
+    PVFS_fs_id fs_id,
+    int* free_config_flag)
 {
     int ret = -PVFS_EINVAL;
     server_config_t *config = NULL;
     struct qlist_head *hash_link = NULL;
 
+    *free_config_flag = 0;
+
     gossip_debug(GOSSIP_CLIENT_DEBUG, "PINT_server_config_mgr_add_"
                  "config: adding config %p\n", config_s);
 
@@ -245,6 +248,10 @@ int PINT_server_config_mgr_add_config(
             assert(config);
             assert(config->server_config);
             config->ref_count++;
+            /* set a flag to inform caller that we aren't using the config
+             * structure
+             */
+            *free_config_flag = 1;
             gen_mutex_unlock(s_server_config_mgr_mutex);
             return(0);
         }

Index: server-config-mgr.h
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/common/misc/server-config-mgr.h,v
diff -p -u -r1.7 -r1.7.26.1
--- server-config-mgr.h	15 May 2006 22:25:05 -0000	1.7
+++ server-config-mgr.h	5 Apr 2007 15:49:38 -0000	1.7.26.1
@@ -17,7 +17,8 @@ int PINT_server_config_mgr_reload_cached
 
 int PINT_server_config_mgr_add_config(
     struct server_configuration_s *config_s,
-    PVFS_fs_id fs_id);
+    PVFS_fs_id fs_id,
+    int* free_config_flag);
 
 int PINT_server_config_mgr_remove_config(
     PVFS_fs_id fs_id);



More information about the Pvfs2-cvs mailing list