Re: ramdisk problem

Chad Page (page0588@sundance.sjsu.edu)
Sun, 9 Jun 1996 21:43:36 -0700 (PDT)


On Sat, 8 Jun 1996, Albert Cahalan wrote:

> Something changed the ramdisk behavior from 1.3.93 to 1.99.12.
>
> In Linux 1.3.93, this works fine:
> dd if=/dev/zero of=/dev/ram0 bs=1k count=1
> But 1.3.93 seems to have a limit of 2880 kB.
> kernel: end_request: I/O error, dev 01:00, sector 5760
>
I think it's 4MB now by default - it changed somewhere in the 1.3.9x
kernels IIRC.

> In Linux 1.99.12, writes to /dev/ram0 won't work at all.
> kernel: end_request: I/O error, dev 01:00, sector 0
>
> The device is correct according to the device list, /proc tells me
> that it is in the kernel, I'm not out of ram, I do have permission
> to write to the device... What happened?
>
Are you running it as a module? I'm having no problems on this
end (although I have another bug report), and I can't track down why it
wouldn't work... it's failing at sector 8192 as it should.

(I used 1.99.14 and 2.0.0 to test it though...)

My suspiscion is that as a module, the ramdisk driver isn't
initalizing the ramdisk size properly at all. The patch after the
message should fix it (against 1.99.14) - although it's completely
untested :)

(specifcally, rd_size is being corrupted somehow...)

- Chad

--- rd.c.orig Fri Jun 7 19:27:31 1996
+++ rd.c Fri Jun 7 19:29:31 1996
@@ -295,8 +295,9 @@

int init_module(void)
{
- int error = rd_init();
- if (!error)
+ rd_size = 4096; /* Looks like this isn't preset in the module version */
+
+ if (rd_init())
printk(KERN_INFO "RAMDISK: Loaded as module.\n");
return error;
}