RE: JMicron Raid Problems on a Gigabyte GA-P35-DS3

"Phil Higgins" <[email protected]>
Newsgroups gmane.linux.ataraid
Message-ID <1B9E00F37DBD544081998E37357E65BB0EB67B@shadserv3.shadowsystems.local>
If you want to give it a go, see below.
It's fairly simple - just copying the string to a temporary buffer big enough to hold the maximum length name plus null termination, then working backwards stripping the spaces out by replacing them with nulls.

I don't know if it's necessary for all Jmicron controllers or just the Gigabyte motherboard ones - but it shouldn't cause anything bad to happen under any circumstances.

Philip Higgins.

---------
--- 1.0.0.rc14/lib/format/ataraid/jm.c	2007-10-15 09:59:28.000000000 +1000
+++ 1.0.0.rc14-fixed/lib/format/ataraid/jm.c	2007-10-15 10:21:50.000000000 +1000
@@ -29,8 +29,22 @@
 	struct jm *jm = META(rd, jm);
 	char buf[2], *ret, *name = (char *) jm->name;
 
-	/* Name always 0 terminated ? */
-	if ((len = strlen(name)) > JM_NAME_LEN)
+	char namebuf[JM_NAME_LEN+1]; 
+	strncpy(namebuf,name,JM_NAME_LEN);
+	namebuf[JM_NAME_LEN] = '\0';
+
+	int i;
+
+	for (i=JM_NAME_LEN; i>0; i--)
+	{
+		if (namebuf[i] == ' ')
+			namebuf[i] = '\0';
+		else
+			break;
+	}
+
+	/* Name always 0 terminated ? - It is now. */
+	if ((len = strlen(namebuf)) > JM_NAME_LEN)
 		len = JM_NAME_LEN;
 
 	len += sizeof(HANDLER) + 2;
@@ -43,7 +57,7 @@
 		else
 			*buf = 0;
 
-		sprintf(ret, "%s_%s%s", HANDLER, name, buf);
+		sprintf(ret, "%s_%s%s", HANDLER, namebuf,buf);
 	}
 
 	return ret;
---------
If patch is mangled by Outlook, grab from http://shadowsystems.com.au/jmicron.patch

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Andreas Geringer
Sent: Saturday, 13 October 2007 2:16 AM
To: ATARAID (eg, Promise Fasttrak, Highpoint 370) related discussions
Subject: Re: JMicron Raid Problems on a Gigabyte GA-P35-DS3

If it is not too much to do for you, I would like to try the patch.

I have another sata-device without raid with the new gentoo-system. So 
it is not really urgent for me.  I think I have also the time to wait 
for the new version.

Andreas Geringer


No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.488 / Virus Database: 269.14.10/1070 - Release Date: 14/10/2007 9:22 AM
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.