[PVFS2-CVS]
commit by neill in pvfs2/src/common/misc: msgpairarray.sm
pvfs2-util.c
CVS commit program
cvs at parl.clemson.edu
Thu Oct 21 11:54:59 EDT 2004
Update of /projects/cvsroot/pvfs2/src/common/misc
In directory parlweb:/tmp/cvs-serv7866/src/common/misc
Modified Files:
msgpairarray.sm pvfs2-util.c
Log Message:
- applied a reworked version of David's patch first posted here:
http://www.beowulf-underground.org/pipermail/pvfs2-developers/2004-October/000949.html
the following changes apply to the msgpairaray.sm failure case:
1) set local_enc_and_alloc *after* the encoding and memory allocation,
rather than optimistically before both
2) clear local_enc_and_alloc after freeing resources in the case that
the failure becomes a failure loop
Index: msgpairarray.sm
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/common/misc/msgpairarray.sm,v
diff -p -u -r1.23 -r1.24
--- msgpairarray.sm 16 Sep 2004 20:01:56 -0000 1.23
+++ msgpairarray.sm 21 Oct 2004 14:54:59 -0000 1.24
@@ -168,6 +168,7 @@ static int msgpairarray_post(PARENT_SM *
struct filesystem_configuration_s *cur_fs = NULL;
int num_incomplete_msgpairs = (sm_p->msgarray_params.comp_ct / 2);
int must_loop_encodings = 0;
+ int local_enc_and_alloc = 0;
gossip_debug(
GOSSIP_MSGPAIR_DEBUG, "(%p) msgpairarray state: post "
@@ -260,6 +261,7 @@ static int msgpairarray_post(PARENT_SM *
js_p->error_code = -PVFS_ENOMEM;
return 1;
}
+ local_enc_and_alloc = 1;
}
session_tag = PINT_util_get_next_tag();
@@ -314,6 +316,16 @@ static int msgpairarray_post(PARENT_SM *
msg_p->send_status.error_code = msg_p->recv_status.error_code;
msg_p->op_status = msg_p->recv_status.error_code;
sm_p->msgarray_params.comp_ct -= 2;
+
+ if (local_enc_and_alloc)
+ {
+ PINT_encode_release(&msg_p->encoded_req, PINT_ENCODE_REQ);
+ BMI_memfree(msg_p->svr_addr,msg_p->encoded_resp_p,
+ msg_p->max_resp_sz, BMI_RECV);
+ msg_p->encoded_resp_p = NULL;
+ local_enc_and_alloc = 0;
+ }
+
/* continue to send other array entries if possible */
continue;
}
Index: pvfs2-util.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/common/misc/pvfs2-util.c,v
diff -p -u -r1.72 -r1.73
--- pvfs2-util.c 11 Oct 2004 16:55:13 -0000 1.72
+++ pvfs2-util.c 21 Oct 2004 14:54:59 -0000 1.73
@@ -879,15 +879,14 @@ int PVFS_util_init_defaults(void)
if (found_one)
{
- return(0);
- }
- else
- {
- gossip_err(
- "ERROR: could not initialize any file systems in %s.\n",
- tab->tabfile_name);
- return(-PVFS_ENODEV);
+ return 0;
}
+
+ gossip_err("ERROR: could not initialize any file systems "
+ "in %s.\n", tab->tabfile_name);
+
+ PVFS_sys_finalize();
+ return -PVFS_ENODEV;
}
/*********************/
More information about the PVFS2-CVS
mailing list