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

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

 



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: ataraid-list-bounces@xxxxxxxxxx [mailto:ataraid-list-bounces@xxxxxxxxxx] 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
 

_______________________________________________
Ataraid-list mailing list
Ataraid-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/ataraid-list

[Index of Archives]     [Linux RAID]     [Linux Device Mapper]     [Linux IDE]     [Linux SCSI]     [Kernel]     [Linux Books]     [Linux Admin]     [GFS]     [RPM]     [Yosemite Campgrounds]     [AMD 64]

  Powered by Linux