From: David Howells <dhowells@redhat.com>
To: Andrew Morton <akpm@osdl.org>
Cc: David Howells <dhowells@redhat.com>,
torvalds@osdl.org, linux-kernel@vger.kernel.org,
uclinux-dev@uclinux.org
Subject: Re: [PATCH 1/2] NOMMU: Set BDI capabilities for /dev/mem and /dev/kmem
Date: Wed, 30 Aug 2006 10:24:55 +0100 [thread overview]
Message-ID: <22155.1156929895@warthog.cambridge.redhat.com> (raw)
In-Reply-To: <20060829112030.a2a8c763.akpm@osdl.org>
Andrew Morton <akpm@osdl.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
prev parent reply other threads:[~2006-08-30 9:25 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-29 17:59 David Howells
2006-08-29 17:59 ` [PATCH 2/2] NOMMU: Check that access_process_vm() has a valid target David Howells
2006-08-29 18:20 ` [PATCH 1/2] NOMMU: Set BDI capabilities for /dev/mem and /dev/kmem Andrew Morton
2006-08-29 18:39 ` David Howells
2006-08-29 19:28 ` Andrew Morton
2006-08-30 8:38 ` David Howells
2006-08-30 15:05 ` Andrew Morton
2006-08-30 9:24 ` David Howells [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=22155.1156929895@warthog.cambridge.redhat.com \
--to=dhowells@redhat.com \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@osdl.org \
--cc=uclinux-dev@uclinux.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®