Linux RAID subsystem development
 help / color / mirror / Atom feed
* [Small Patch] for raidlib.c in raidtools-1.00.3
@ 2003-02-25 13:49 Florian Schanda
  2003-02-25 14:31 ` Stephen Lee
  0 siblings, 1 reply; 3+ messages in thread
From: Florian Schanda @ 2003-02-25 13:49 UTC (permalink / raw)
  To: linux-raid

[-- Attachment #1: Type: text/plain, Size: 343 bytes --]

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

[-- Attachment #2: error-reporting.patch --]
[-- Type: text/x-diff, Size: 1036 bytes --]

--- raidlib.c.orig	Tue Feb 25 13:38:46 2003
+++ raidlib.c	Tue Feb 25 13:44:44 2003
@@ -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;

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Small Patch] for raidlib.c in raidtools-1.00.3
  2003-02-25 13:49 [Small Patch] for raidlib.c in raidtools-1.00.3 Florian Schanda
@ 2003-02-25 14:31 ` Stephen Lee
  2003-02-25 18:04   ` Florian Schanda
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Lee @ 2003-02-25 14:31 UTC (permalink / raw)
  To: linux-raid


Florian Schanda said:
> 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



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Small Patch] for raidlib.c in raidtools-1.00.3
  2003-02-25 14:31 ` Stephen Lee
@ 2003-02-25 18:04   ` Florian Schanda
  0 siblings, 0 replies; 3+ messages in thread
From: Florian Schanda @ 2003-02-25 18:04 UTC (permalink / raw)
  To: splee, linux-raid

On Tuesday 25 February 2003 14:31, Stephen Lee wrote:
> Shouldn't that be /dev/md0?

Not if you're using devfs.

	- Florian Schanda

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-02-25 18:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-02-25 13:49 [Small Patch] for raidlib.c in raidtools-1.00.3 Florian Schanda
2003-02-25 14:31 ` Stephen Lee
2003-02-25 18:04   ` Florian Schanda

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox