jffs2_flash_writev(): Non-contiguous write to 00825300 with mtd_dataflash
Haavard Skinnemoen
hskinnemoen at atmel.com
Wed Nov 29 08:26:07 EST 2006
On Tue, 28 Nov 2006 14:36:17 +0200
Artem Bityutskiy <dedekind at infradead.org> wrote:
> On Tue, 2006-11-28 at 12:58 +0100, Haavard Skinnemoen wrote:
> > +#define jffs2_can_mark_obsolete(c) (c->mtd->flags &
> > (MTD_BIT_WRITEABLE) \
> > + && !jffs2_dataflash(c))
>
> Please, make sure the DataFlash driver does has MTD_BIT_WRITEABLE bit
> set at c->mtd->flags instead
Ok, how about this instead? It seems to work equally well on my board.
Haavard
---
From: Haavard Skinnemoen <hskinnemoen at atmel.com>
Subject: [PATCH] [MTD] Don't set MTD_BIT_WRITEABLE for DataFlash
Attempting to write something to a file on a jffs2 filesystem using
mtd_dataflash often results in the following BUG:
jffs2_flash_writev(): Non-contiguous write to 00825720
wbuf was previously 00825300-0082530c
kernel BUG at /home/hskinnemoen/git/linux-devel/fs/jffs2/wbuf.c:786!
Fix this by not setting MTD_BIT_WRITEABLE for DataFlash devices, thus
causing jffs2_can_mark_obsolete() to return 0.
Signed-off-by: Haavard Skinnemoen <hskinnemoen at atmel.com>
---
drivers/mtd/devices/mtd_dataflash.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/mtd/devices/mtd_dataflash.c b/drivers/mtd/devices/mtd_dataflash.c
index 5db7160..10a4f4e 100644
--- a/drivers/mtd/devices/mtd_dataflash.c
+++ b/drivers/mtd/devices/mtd_dataflash.c
@@ -480,7 +480,7 @@ add_dataflash(struct spi_device *spi, ch
device->writesize = pagesize;
device->owner = THIS_MODULE;
device->type = MTD_DATAFLASH;
- device->flags = MTD_CAP_NORFLASH;
+ device->flags = MTD_WRITEABLE;
device->erase = dataflash_erase;
device->read = dataflash_read;
device->write = dataflash_write;
--
1.4.3.3
More information about the linux-mtd
mailing list