Skip to contentSkip to conversation

block2mtd: Overrun end of disk in cache readahead

DISCUSSION Ville Herva 3 participants 5 messages Jul 5, 2006 – Jul 6, 2006 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

I get
block2mtd: Overrun end of disk in cache readahead

each time I mount a JFFS2 created with

	mkfs.jffs2 -o IMAGE -d skeleton --pad=999161856 -v
	dd if=IMAGE of=/dev/hdc2

Afaict, the fs should fit onto the device:

	du --block-size=512 --apparent-size IMAGE
	1951488 IMAGE
	blockdev --getsize /dev/hdc2             
	1951488
	blockdev --getsize /dev/mtdblock0        
	1951488

Should I leave some blocks worth of space in the end nevertheless?

-- v --

[email protected]

#1 lore raw

Ville,
Try changing the PAGE_READAHEAD define in
/drivers/mtd/devices/block2mtd.c from 64 to 0:

-#define PAGE_READAHEAD 64
+#define PAGE_READAHEAD 0

Or a bit more sophisticated:

in drivers/mtd/devices/Kconfig ...

+config MTD_BLOCK2MTD_PAGE_READAHEAD

+    int "How many pages block2mtd reads ahead"
+    depends on MTD_BLOCK2MTD
+    default "64"
+    help

+ This allows you to configure the PAGE_READAHEAD value of the
+ MTD_BLOCK2MTD driver.
+

... and in drivers/mtd/devices/block2mtd.c

-#define PAGE_READAHEAD 64
+#define PAGE_READAHEAD CONFIG_MTD_BLOCK2MTD_PAGE_READAHEAD

Signature · 1 line
Norbert
Quoted 30 lines · Ville Herva

I get
block2mtd: Overrun end of disk in cache readahead

each time I mount a JFFS2 created with

	mkfs.jffs2 -o IMAGE -d skeleton --pad=999161856 -v
	dd if=IMAGE of=/dev/hdc2

Afaict, the fs should fit onto the device:

	du --block-size=512 --apparent-size IMAGE
	1951488 IMAGE
	blockdev --getsize /dev/hdc2             
	1951488
	blockdev --getsize /dev/mtdblock0        
	1951488

Should I leave some blocks worth of space in the end nevertheless?

-- v --

[email protected]

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

#2 lore raw

Review

Quoted 6 lines · you [Norbert Federa]

Ville,
Try changing the PAGE_READAHEAD define in
/drivers/mtd/devices/block2mtd.c from 64 to 0:

(quoted diff) +1 -1
-#define PAGE_READAHEAD 64
+#define PAGE_READAHEAD 0

Thanks.

Looking at the source, it almost looks like the error message is just a spurious warning, not a dangerous error. Doesn't this happen when the underlying device does not end at 64k boundary? And the readahead code just stops reading ahead after that warning?

-- v --

[email protected]

#3 lore raw
Quoted 5 lines · Ville Herva
Quoted 4 lines · you [Norbert Federa]

Ville,
Try changing the PAGE_READAHEAD define in
/drivers/mtd/devices/block2mtd.c from 64 to 0:

Quoted 7 lines

Review

Quoted 2 lines
(quoted diff) +1 -1
-#define PAGE_READAHEAD 64
+#define PAGE_READAHEAD 0

Looking at the source, it almost looks like the error message is just a spurious warning, not a dangerous error. Doesn't this happen when the underlying device does not end at 64k boundary? And the readahead code just stops reading ahead after that warning?

I'm fairly tempted to just nuke the readahead code completely. For some users, it is outright harmful (usbstick, some other flash behind blockdev interface), for others it should be done by the block device driver, not by block2mtd.

If either of you wants to do that and can test the resulting patch, you have my blessing.

Jörn

Signature · 2 lines
This above all: to thine own self be true.
-- Shakespeare
#4 lore raw
Quoted 8 lines · you [Jörn Engel]

I'm fairly tempted to just nuke the readahead code completely. For some users, it is outright harmful (usbstick, some other flash behind blockdev interface), for others it should be done by the block device driver, not by block2mtd.

If either of you wants to do that and can test the resulting patch, you have my blessing.

I'm afraid the box I tested this with already has already gone to "production". So I currently have zero flash devices I could test this on. Of course, I guess I could just use regular block device (a loop file, even)...

-- v --

[email protected]