[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [Linux-cluster] GFS 6.0 crashing x86_64 machine



On Mon, Aug 02, 2004 at 01:59:55PM -0700, micah nerren wrote:
[snip]
> I hope this helps!!
[snip]

yeah, looks like a stack overflow.
here's a patch that I put in for 6.0.  (patch works on 6.0.0-7)


-- 
Michael Conrad Tadpol Tilstra
Duct tape is like the force.  It has a light side and a dark side and it
holds the universe together.
===================================================================
RCS file: /mnt/export/cvs/GFS/locking/lock_gulm/kernel/gulm_fs.c,v
retrieving revision 1.1.2.16
retrieving revision 1.1.2.17
diff -u -r1.1.2.16 -r1.1.2.17
--- GFS/locking/lock_gulm/kernel/gulm_fs.c	2004/07/20 16:54:18	1.1.2.16
+++ GFS/locking/lock_gulm/kernel/gulm_fs.c	2004/08/02 16:12:39	1.1.2.17
@@ -335,11 +335,17 @@
 	    unsigned int min_lvb_size, struct lm_lockstruct *lockstruct)
 {
 	gulm_fs_t *gulm;
-	char work[256], *tbln;
+	char *work=NULL, *tbln;
 	int first;
 	int error = -1;
 	struct list_head *lltmp;
 
+	work = kmalloc(256, GFP_KERNEL);
+	if(work == NULL ) {
+		log_err("Out of Memory.\n");
+		error = -ENOMEM;
+		goto fail;
+	}
 	strncpy (work, table_name, 256);
 
 	tbln = strstr (work, ":");
@@ -483,6 +489,7 @@
 
       fail:
 
+	if(work != NULL ) kfree(work);
 	gulm_cm.starts = FALSE;
 	log_msg (lgm_Always, "fsid=%s: Exiting gulm_mount with errors %d\n",
 		 table_name, error);
@@ -570,7 +577,7 @@
 {
 	gulm_fs_t *fs = (gulm_fs_t *) lockspace;
 	int err;
-	uint8_t name[256];
+	uint8_t name[64];
 
 	if (message != LM_RD_SUCCESS) {
 		/* Need to start thinking about how I want to use this... */
@@ -579,7 +586,7 @@
 
 	if (jid == fs->fsJID) {	/* this may be drifting crud through. */
 		/* hey! its me! */
-		strncpy (name, gulm_cm.myName, 256);
+		strncpy (name, gulm_cm.myName, 64);
 	} else if (lookup_name_by_jid (fs, jid, name) != 0) {
 		log_msg (lgm_JIDMap,
 			 "fsid=%s: Could not find a client for jid %d\n",

Attachment: pgp00001.pgp
Description: PGP signature


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]