Skip to contentSkip to conversation

for raidlib.c in raidtools-1.00.3

PATCH In review Florian Schanda 2 participants 3 messages Feb 25, 2003 MD RAID

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 for raidlib.c in raidtools-1.00.3

Hi all,

I had some problems with raidtools, it gave me a wierd error saying

"/dev/md/0: Invalid argument"

After spending some time to fix it, I figured it would be a good idea to actually load the kernel module. ;)

To save save some trouble, I enhaced the error reporting for that particular function.

- Florian Schanda

raidlib.c renamed from raidlib.c.orig +20 -14
@@ -149,20 +149,26 @@
 	    return 0;
 	}
 
-    if ((rc = ioctl (fd, RUN_ARRAY, (unsigned long)param))) {
-	    save_errno=errno;
-	    switch (save_errno) {
-	      case EBUSY:
-		fprintf(stderr,"%s: already running\n",dev);
-		break;
-		/* fall through */
-	      default:
-		perror (dev);
-	    }
-	    errno=save_errno;
-	    return 1;
-    }
-    return 0;
+	if ((rc = ioctl (fd, RUN_ARRAY, (unsigned long)param))) {
+		save_errno=errno;
+		switch (save_errno) {
+			case EBUSY:
+				fprintf(stderr,"%s: already running\n", dev);
+				break;
+			case EINVAL:
+				fprintf(stderr, "Error: EINVAL\n");
+				fprintf(stderr, "Request or argp is not valid.\n");
+				fprintf(stderr, "Are you *SURE* you compiled raid into the kernel, and loaded it?\n");
+				break;
+			/* fall through */
+			default:
+				perror (dev);
+		}
+		errno=save_errno;
+		return 1;
+	}
+	
+	return 0;
 }
 static int do_mdstart (int fd, char *dev, dev_t rdev) {
     int rc;
#1 lore raw
Quoted 7 lines · Florian Schanda

Hi all,

I had some problems with raidtools, it gave me a wierd error saying

"/dev/md/0: Invalid argument"

Shouldn't that be /dev/md0?

Stephen

#2 lore raw
Quoted 1 line · Stephen Lee

Shouldn't that be /dev/md0?

Not if you're using devfs.

- Florian Schanda