--- Begin Message ---
I've attached a patch to this E-mail. I've also included it in the
test12 release (with one small fix), and this will be in the 2.4.0
release. Note, I haven't tested it yet, but it should work for you.
Just apply it to your drivers/block/vmdump.c.
Let me know ...
--Matt
elh wrote:
>
> Hi Matt,
>
> The error is:
>
> can not open device /dev/vmdump ........................
> .....................................................[-36]
>
> Where the ... are 1024 or so of garbage.
>
> I patched the test11 kernel and it just does not work. I am about
> to try without adding in the kernel-2.4.0 patches for string and cipe.
>
> Any help is appreciated,
> Edward L. Haletky
>
> > -----Original Message-----
> > From: root@xxxxxxxxxxxxx [mailto:root@xxxxxxxxxxxxx]On Behalf Of Matt D.
> > Robinson
> > Sent: Tuesday, January 16, 2001 12:38 PM
> > To: elh
> > Cc: lkcd@xxxxxxxxxxx
> > Subject: Re: IDE and v2.4 kernels
> >
> >
> > elh wrote:
> > >
> > > Hi,
> > >
> > > I use v2.4-test11 kernels and was wondering if IDE swap devices was
> > > supported
> > > for lkcd?
> > >
> > > Every time I run /sbin/vmdump config I get a can not open
> > device error even
> > > though the
> > > /dev/vmdump points to /dev/hda6.
> > >
> > > Any help is appreciated.
> > >
> > > _Edward Haletky
> >
> > Sorry, was on vacation ...
> >
> > This should work fine, Tom and I have both used IDE devices for the 2.4
> > kernels without a problem. Are you sure /dev/hda6 is valid? Also, can
> > you send me the exact error message, just in case there's something else
> > there?
> >
> > --Matt
> >
--- vmdump.c.orig Tue Jan 16 12:46:59 2001
+++ vmdump.c Tue Jan 16 12:46:09 2001
@@ -5,7 +5,11 @@
*
* Copyright 1999 Silicon Graphics, Inc. All rights reserved.
*
- * Linux 2.4 modifications by: Matt D. Robinson (yakker@xxxxxxxxxxxxxx)
+ * Linux 2.3 modifications by: Matt D. Robinson (yakker@xxxxxxxxxxxxxx)
+ * Copyright 2000 TurboLinux, Inc. All rights reserved.
+ *
+ * Linux 2.4 modifications by: Matt D. Robinson (yakker@xxxxxxxxxxxxxx)
+ * Copyright 2001 Alacritech, Inc. All rights reserved.
*
*/
@@ -37,6 +41,10 @@
#include <linux/string.h>
#include <linux/utsname.h>
+#ifndef min
+#define min(a,b) (((a)<(b))?(a):(b))
+#endif
+
/* make sure TRUE and false are defined */
#ifdef TRUE
#undef TRUE
@@ -234,7 +242,7 @@
unsigned long count, void *data)
{
int i;
- char buf[PATH_MAX];
+ char *page;
/* skip over leading whitespace */
while (count && isspace(*buffer)) {
@@ -242,19 +250,22 @@
++buffer;
}
- /* copy the rest of the contents */
- sprintf(buf, "%s", buffer);
-
- /* remove trailing newline */
- buf[strlen(buf)-1] = 0;
+ if (!(page = (char *)__get_free_page(GFP_KERNEL))) {
+ return -ENOMEM;
+ }
+
+ copy_from_user(page, buffer, count = (min(count, PAGE_SIZE)));
+ if (*(page + count - 1) == '\n') {
+ *(page + count - 1) = 0;
+ }
/* call dump_open() and return results */
- i = dump_open((char *)buf);
+ i = dump_open(page);
+ free_page((unsigned long)page);
if (!i) {
return (count);
- } else {
- return (i);
}
+ return (i);
}
/*
--- End Message ---