From: akpm@linux-foundation.org
To: dwmw2@infradead.org
Cc: david-b@pacbell.net, linux-mtd@lists.infradead.org,
trimarchimichael@yahoo.it, akpm@linux-foundation.org,
jwboyer@gmail.com, rmk@arm.linux.org.uk
Subject: [patch 02/13] jffs2 summary allocation: don't use vmalloc()
Date: Wed, 30 Jul 2008 12:34:56 -0700 [thread overview]
Message-ID: <200807301934.m6UJYvtA012276@imap1.linux-foundation.org> (raw)
From: Michael Trimarchi <trimarchimichael@yahoo.it>
arm:
Unable to handle kernel NULL pointer dereference at virtual address 00000000
pgd = c0004000
[00000000] *pgd=00000000
stopped custom tracer.
Internal error: Oops: 817 [#1] PREEMPT
Modules linked in:
CPU: 0 Not tainted (2.6.24-rc5-rt1 #37)
PC is at dma_cache_maint+0x40/0x80
LR is at atmel_spi_transfer+0x94/0x178
This is because the SPI layer is using DMA transfers to support jffs2 I/O, and
apparently jffs2 isn't used to having DMA done against this buffer. DMA
against vmalloced memory plain isn't allowed.
This patch will probably break all sorts of things because that buffer is
&*large*: up to half a meg.
So this patch isn't mergeable. I'll hang onto it to bug dmwm2 with when he
reincarnates.
Cc: David Brownell <david-b@pacbell.net>
Cc: Josh Boyer <jwboyer@gmail.com>
Cc: Russell King <rmk@arm.linux.org.uk>
Cc: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
fs/jffs2/summary.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff -puN fs/jffs2/summary.c~jffs2-summary-allocation-dont-use-vmalloc fs/jffs2/summary.c
--- a/fs/jffs2/summary.c~jffs2-summary-allocation-dont-use-vmalloc
+++ a/fs/jffs2/summary.c
@@ -17,7 +17,6 @@
#include <linux/pagemap.h>
#include <linux/crc32.h>
#include <linux/compiler.h>
-#include <linux/vmalloc.h>
#include "nodelist.h"
#include "debug.h"
@@ -30,7 +29,7 @@ int jffs2_sum_init(struct jffs2_sb_info
return -ENOMEM;
}
- c->summary->sum_buf = vmalloc(c->sector_size);
+ c->summary->sum_buf = kmalloc(c->sector_size, GFP_KERNEL);
if (!c->summary->sum_buf) {
JFFS2_WARNING("Can't allocate buffer for writing out summary information!\n");
@@ -49,7 +48,7 @@ void jffs2_sum_exit(struct jffs2_sb_info
jffs2_sum_disable_collecting(c->summary);
- vfree(c->summary->sum_buf);
+ kfree(c->summary->sum_buf);
c->summary->sum_buf = NULL;
kfree(c->summary);
_
next reply other threads:[~2008-07-30 19:34 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-30 19:34 akpm [this message]
2008-07-30 22:39 ` [patch 02/13] jffs2 summary allocation: don't use vmalloc() David Brownell
2008-07-30 22:46 ` Andrew Morton
2008-07-31 5:10 ` David Brownell
2008-07-31 5:37 ` Artem Bityutskiy
2008-07-31 6:57 ` David Brownell
2008-07-31 8:03 ` Artem Bityutskiy
2008-07-31 5:15 ` Artem Bityutskiy
2008-07-31 6:56 ` David Brownell
2008-07-31 8:00 ` Artem Bityutskiy
2008-07-31 8:48 ` David Woodhouse
2008-07-31 9:09 ` David Woodhouse
2008-07-31 7:33 ` David Woodhouse
2008-07-31 8:21 ` David Brownell
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=200807301934.m6UJYvtA012276@imap1.linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=david-b@pacbell.net \
--cc=dwmw2@infradead.org \
--cc=jwboyer@gmail.com \
--cc=linux-mtd@lists.infradead.org \
--cc=rmk@arm.linux.org.uk \
--cc=trimarchimichael@yahoo.it \
/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