[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <22155.1156929895@warthog.cambridge.redhat.com>
Date: Wed, 30 Aug 2006 10:24:55 +0100
From: David Howells <dhowells@...hat.com>
To: Andrew Morton <akpm@...l.org>
Cc: David Howells <dhowells@...hat.com>, torvalds@...l.org,
linux-kernel@...r.kernel.org, uclinux-dev@...inux.org
Subject: Re: [PATCH 1/2] NOMMU: Set BDI capabilities for /dev/mem and /dev/kmem
Andrew Morton <akpm@...l.org> wrote:
> Perhaps one could make mem_bdi==NULL if !CONFIG_MMU, for a minor space
> saving.
The problem is that takes the #ifdef-avoidance scheme a step too far. If we
do that, the kernel will crash. Observe the following:
Breakpoint 1, memory_open (inode=0xc0f7da04, filp=0xc09d8ba0) at fs.h:635
635 return MINOR(inode->i_rdev);
(gdb) n
634 {
(gdb)
904 filp->f_mapping->backing_dev_info = &mem_bdi;
(gdb) i sym filp->f_mapping->backing_dev_info
default_backing_dev_info in section .data
Note how the BDI pointer is already set to the default which we then override.
We either need to fill in mem_bdi correctly for MMU or only override the BDI
pointer if !MMU.
Of course, that doesn't touch on the matter of the compiler not letting you do
&NULL, though I assume you meant make &mem_bdi == NULL.
Also, the default BDI is incorrect for /dev/mem and /dev/kmem since it does
not permit shared mappings, so I think we need mem_bdi anyway, though I should
perhaps make it more general, so that it can apply to all mappable chardevs.
David
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists