* Re: 2.6.0-test1 devfs question
@ 2003-07-28 7:13 "Andrey Borzenkov"
2003-07-28 7:22 ` Andrew Morton
0 siblings, 1 reply; 3+ messages in thread
From: "Andrey Borzenkov" @ 2003-07-28 7:13 UTC (permalink / raw)
To: "Andrew Morton" ; +Cc: linux-kernel, "Daniele Venzano"
>
> The patch is broken - 2.4 does /dev/md/2 as well.
>
> So what is the bug? Why are people suddenly having problems with this?
>
Daniele did some debugging, result is:
=================
Buggy config
------------
GRUB command line: kernel (hd0,1)/testing root=/dev/md2
video=radeonfb:1024x768-32@60
As output there is only (copied by hand):
[...]
raid1: raid set md2 active with 2 out of 2 mirrors
md: ... autorun DONE.
create_dev: name=/dev/root dev=902 dname=md2
VFS: cannot open root device "md2" or md2
please append a correct "root=" boot option
Kernel panic: VFS: unable to mount root fs on md2
<STOP>
==================
the bug is almost for sure in init/do_mount_devfs.c:read_dir; it
allocates static buffer of size at most 2**MAX_ORDER and tries to
read the whole dir at once. md driver creates all minors in md_init
i.e. 256 (2**MINORBITS). MAX_ORDER default is 11 so we have at most
2K which is enough for appr. 200 entries; 256 do not fit :)
Daniel, please, could you change read_dir to just allocate bigger
buffer - 4K should do - and test once more?
I'll see what can be done. Anyone sees reason why normal directory
scan won't work here?
-andrey
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: 2.6.0-test1 devfs question
2003-07-28 7:13 2.6.0-test1 devfs question "Andrey Borzenkov"
@ 2003-07-28 7:22 ` Andrew Morton
2003-07-28 15:59 ` [BUG SQUISHED] " Daniele Venzano
0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2003-07-28 7:22 UTC (permalink / raw)
To: Andrey Borzenkov; +Cc: linux-kernel, webvenza
"Andrey Borzenkov" <arvidjaar@mail.ru> wrote:
>
> the bug is almost for sure in init/do_mount_devfs.c:read_dir; it
> allocates static buffer of size at most 2**MAX_ORDER and tries to
> read the whole dir at once.
Yes, that function is buggy.
diff -puN init/do_mounts_devfs.c~read_dir-fix init/do_mounts_devfs.c
--- 25/init/do_mounts_devfs.c~read_dir-fix 2003-07-28 00:21:40.000000000 -0700
+++ 25-akpm/init/do_mounts_devfs.c 2003-07-28 00:21:40.000000000 -0700
@@ -54,7 +54,7 @@ static void * __init read_dir(char *path
if (fd < 0)
return NULL;
- for (size = 1 << 9; size <= (1 << MAX_ORDER); size <<= 1) {
+ for (size = 1 << 9; size <= (PAGE_SIZE << MAX_ORDER); size <<= 1) {
void *p = kmalloc(size, GFP_KERNEL);
int n;
if (!p)
_
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [BUG SQUISHED] 2.6.0-test1 devfs question
2003-07-28 7:22 ` Andrew Morton
@ 2003-07-28 15:59 ` Daniele Venzano
0 siblings, 0 replies; 3+ messages in thread
From: Daniele Venzano @ 2003-07-28 15:59 UTC (permalink / raw)
To: Andrew Morton; +Cc: Andrey Borzenkov, Linux Kernel Mailing List
On Mon, Jul 28, 2003 at 12:22:16AM -0700, Andrew Morton wrote:
> "Andrey Borzenkov" <arvidjaar@mail.ru> wrote:
> >
> > the bug is almost for sure in init/do_mount_devfs.c:read_dir; it
> > allocates static buffer of size at most 2**MAX_ORDER and tries to
> > read the whole dir at once.
>
> Yes, that function is buggy.
>
> diff -puN init/do_mounts_devfs.c~read_dir-fix init/do_mounts_devfs.c
> --- 25/init/do_mounts_devfs.c~read_dir-fix 2003-07-28 00:21:40.000000000 -0700
> +++ 25-akpm/init/do_mounts_devfs.c 2003-07-28 00:21:40.000000000 -0700
> @@ -54,7 +54,7 @@ static void * __init read_dir(char *path
> if (fd < 0)
> return NULL;
>
> - for (size = 1 << 9; size <= (1 << MAX_ORDER); size <<= 1) {
> + for (size = 1 << 9; size <= (PAGE_SIZE << MAX_ORDER); size <<= 1) {
> void *p = kmalloc(size, GFP_KERNEL);
> int n;
> if (!p)
>
> _
This patch solves the problem, the kernel boots fine and finds the root
device using root=/dev/md2 as boot option.
The output during boot is:
[...]
raid1: raid set md2 active with 2 out of 2 mirrors
md: ... autorun DONE.
create_dev: name=/dev/root dev=902 dname=md2
create_dev: found real device /dev/md/2
[...]
Thanks everyone, bye.
--
----------------------------------------
Daniele Venzano
Web: http://digilander.iol.it/webvenza/
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2003-07-28 15:44 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-28 7:13 2.6.0-test1 devfs question "Andrey Borzenkov"
2003-07-28 7:22 ` Andrew Morton
2003-07-28 15:59 ` [BUG SQUISHED] " Daniele Venzano
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).