* [RFC] [MTD-utils] mkfs.jffs2: JFFS2 and minimal erase block size
@ 2010-09-01 15:36 Yegor Yefremov
2010-09-02 11:38 ` Artem Bityutskiy
0 siblings, 1 reply; 4+ messages in thread
From: Yegor Yefremov @ 2010-09-01 15:36 UTC (permalink / raw)
To: linux-mtd
[-- Attachment #1: Type: text/plain, Size: 697 bytes --]
Hello,
I'm using a NOR flash SST39VF3201. According to its data sheet the
erase size is 2 Kword. That corresponds to -e 0x1000 value. But the
mkfs.jffs2 utility has a limit of 0x2000 bytes. If I change this limit
to 0x1000 and create an image, I can successfully mount and use it,
with 8KiB value the jffs2 driver fails to work with such an image. I
have found some similar complains like this one
http://lists.infradead.org/pipermail/linux-mtd/2009-February/024523.html,
but no one seems to have asked this question on the list.
Is there any reason for limiting erase block to 0x2000?
I've created a patch to decrease this value to 0x1000, but perhaps
there are any other way?
Regards,
Yegor
[-- Attachment #2: jffs2-erase-block-fix.patch --]
[-- Type: application/octet-stream, Size: 774 bytes --]
Set minimal erase block value to 0x1000 to support flashes
with such erase block
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
Index: b/mkfs.jffs2.c
===================================================================
--- a/mkfs.jffs2.c 2010-09-01 16:07:53.000000000 +0200
+++ b/mkfs.jffs2.c 2010-09-01 16:08:36.000000000 +0200
@@ -1765,10 +1765,10 @@
erase_block_size *= units;
/* If it's less than 8KiB, they're not allowed */
- if (erase_block_size < 0x2000) {
+ if (erase_block_size < 0x1000) {
fprintf(stderr, "Erase size 0x%x too small. Increasing to 8KiB minimum\n",
erase_block_size);
- erase_block_size = 0x2000;
+ erase_block_size = 0x1000;
}
break;
}
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [RFC] [MTD-utils] mkfs.jffs2: JFFS2 and minimal erase block size
2010-09-01 15:36 [RFC] [MTD-utils] mkfs.jffs2: JFFS2 and minimal erase block size Yegor Yefremov
@ 2010-09-02 11:38 ` Artem Bityutskiy
2010-09-07 9:16 ` Yegor Yefremov
0 siblings, 1 reply; 4+ messages in thread
From: Artem Bityutskiy @ 2010-09-02 11:38 UTC (permalink / raw)
To: Yegor Yefremov; +Cc: linux-mtd
On Wed, 2010-09-01 at 17:36 +0200, Yegor Yefremov wrote:
> Hello,
>
> I'm using a NOR flash SST39VF3201. According to its data sheet the
> erase size is 2 Kword. That corresponds to -e 0x1000 value. But the
> mkfs.jffs2 utility has a limit of 0x2000 bytes. If I change this limit
> to 0x1000 and create an image, I can successfully mount and use it,
> with 8KiB value the jffs2 driver fails to work with such an image. I
> have found some similar complains like this one
> http://lists.infradead.org/pipermail/linux-mtd/2009-February/024523.html,
> but no one seems to have asked this question on the list.
>
> Is there any reason for limiting erase block to 0x2000?
>
> I've created a patch to decrease this value to 0x1000, but perhaps
> there are any other way?
JFFS2 should be able to fit at least one node to eraseblock. The maximum
node size is 4KiB+few bytes. This is why the minimum eraseblocks size is
8KiB.
But in practice, even 8KiB is bad because you and up with wasting a lot
of space at the end of eraseblocks.
You should join several erasblock into one virtual eraseblock of 64 or
128 KiB and use it - this will be more optiomal.
So, nack for the patch.
--
Best Regards,
Artem Bityutskiy (Битюцкий Артём)
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [RFC] [MTD-utils] mkfs.jffs2: JFFS2 and minimal erase block size
2010-09-02 11:38 ` Artem Bityutskiy
@ 2010-09-07 9:16 ` Yegor Yefremov
2010-09-07 9:21 ` Artem Bityutskiy
0 siblings, 1 reply; 4+ messages in thread
From: Yegor Yefremov @ 2010-09-07 9:16 UTC (permalink / raw)
To: dedekind1; +Cc: linux-mtd
Hello Artem,
>> I'm using a NOR flash SST39VF3201. According to its data sheet the
>> erase size is 2 Kword. That corresponds to -e 0x1000 value. But the
>> mkfs.jffs2 utility has a limit of 0x2000 bytes. If I change this limit
>> to 0x1000 and create an image, I can successfully mount and use it,
>> with 8KiB value the jffs2 driver fails to work with such an image. I
>> have found some similar complains like this one
>> http://lists.infradead.org/pipermail/linux-mtd/2009-February/024523.html,
>> but no one seems to have asked this question on the list.
>>
>> Is there any reason for limiting erase block to 0x2000?
>>
>> I've created a patch to decrease this value to 0x1000, but perhaps
>> there are any other way?
>
> JFFS2 should be able to fit at least one node to eraseblock. The maximum
> node size is 4KiB+few bytes. This is why the minimum eraseblocks size is
> 8KiB.
>
> But in practice, even 8KiB is bad because you and up with wasting a lot
> of space at the end of eraseblocks.
>
> You should join several erasblock into one virtual eraseblock of 64 or
> 128 KiB and use it - this will be more optiomal.
I tried to use 128KiB, but still got following errors:
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x000f4024:
0xadec instead
Further such events for this erase block will not be printed
Node at 0x000f4fb8 with length 0x0000004a would run over the end of
the erase block
Perhaps the file system was created with the wrong erase size?
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x000f5000:
0x706d instead
# JFFS2 warning: (563) jffs2_do_read_inode_internal: Truncating ino
#318 to 62192 bytes failed because it only had 61440 bytes to start
with!
JFFS2 warning: (563) jffs2_do_read_inode_internal: Truncating ino #424
to 7828 bytes failed because it only had 4096 bytes to start with!
JFFS2 warning: (563) jffs2_do_read_inode_internal: Truncating ino #489 to 11528
bytes failed because it only had 8192 bytes to start with!
To my system:
kernel 2.6.35.1 with following setting regarding JFFS2
#
# Pseudo filesystems
#
CONFIG_PROC_FS=y
CONFIG_PROC_SYSCTL=y
CONFIG_PROC_PAGE_MONITOR=y
CONFIG_SYSFS=y
CONFIG_TMPFS=y
# CONFIG_TMPFS_POSIX_ACL is not set
# CONFIG_HUGETLB_PAGE is not set
CONFIG_CONFIGFS_FS=y
CONFIG_MISC_FILESYSTEMS=y
# CONFIG_ADFS_FS is not set
# CONFIG_AFFS_FS is not set
# CONFIG_HFS_FS is not set
# CONFIG_HFSPLUS_FS is not set
# CONFIG_BEFS_FS is not set
# CONFIG_BFS_FS is not set
# CONFIG_EFS_FS is not set
CONFIG_JFFS2_FS=y
CONFIG_JFFS2_FS_DEBUG=0
# CONFIG_JFFS2_FS_WRITEBUFFER is not set
# CONFIG_JFFS2_SUMMARY is not set
# CONFIG_JFFS2_FS_XATTR is not set
# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
CONFIG_JFFS2_ZLIB=y
# CONFIG_JFFS2_LZO is not set
CONFIG_JFFS2_RTIME=y
# CONFIG_JFFS2_RUBIN is not set
# CONFIG_UBIFS_FS is not set
CONFIG_LOGFS=y
CONFIG_CRAMFS=y
CONFIG_SQUASHFS=y
CONFIG_SQUASHFS_XATTRS=y
CONFIG_SQUASHFS_EMBEDDED=y
CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3
# CONFIG_VXFS_FS is not set
# CONFIG_MINIX_FS is not set
# CONFIG_OMFS_FS is not set
# CONFIG_HPFS_FS is not set
# CONFIG_QNX4FS_FS is not set
# CONFIG_ROMFS_FS is not set
# CONFIG_SYSV_FS is not set
# CONFIG_UFS_FS is not set
# CONFIG_NETWORK_FILESYSTEMS is not set
The file system will be created by buildroot:
mkfs.jffs2 -e 0x20000 -p -l -s 0x1000 -D
target/generic/device_table.txt -d output/target -o
output/images/rootfs.jffs2
mkfs.jffs2: revision 1.60
Prior to burning jffs2 image I have erased the MTD partition with
flash_eraseall -j /dev/mtd2
and then burned image via cat img > /dev/mtdblock2
I'm not using FTL.
Any ideas?
Yegor
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [RFC] [MTD-utils] mkfs.jffs2: JFFS2 and minimal erase block size
2010-09-07 9:16 ` Yegor Yefremov
@ 2010-09-07 9:21 ` Artem Bityutskiy
0 siblings, 0 replies; 4+ messages in thread
From: Artem Bityutskiy @ 2010-09-07 9:21 UTC (permalink / raw)
To: Yegor Yefremov; +Cc: linux-mtd
On Tue, 2010-09-07 at 11:16 +0200, Yegor Yefremov wrote:
> Hello Artem,
>
> >> I'm using a NOR flash SST39VF3201. According to its data sheet the
> >> erase size is 2 Kword. That corresponds to -e 0x1000 value. But the
> >> mkfs.jffs2 utility has a limit of 0x2000 bytes. If I change this limit
> >> to 0x1000 and create an image, I can successfully mount and use it,
> >> with 8KiB value the jffs2 driver fails to work with such an image. I
> >> have found some similar complains like this one
> >> http://lists.infradead.org/pipermail/linux-mtd/2009-February/024523.html,
> >> but no one seems to have asked this question on the list.
> >>
> >> Is there any reason for limiting erase block to 0x2000?
> >>
> >> I've created a patch to decrease this value to 0x1000, but perhaps
> >> there are any other way?
> >
> > JFFS2 should be able to fit at least one node to eraseblock. The maximum
> > node size is 4KiB+few bytes. This is why the minimum eraseblocks size is
> > 8KiB.
> >
> > But in practice, even 8KiB is bad because you and up with wasting a lot
> > of space at the end of eraseblocks.
> >
> > You should join several erasblock into one virtual eraseblock of 64 or
> > 128 KiB and use it - this will be more optiomal.
>
> I tried to use 128KiB, but still got following errors:
>
> jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x000f4024:
> 0xadec instead
> Further such events for this erase block will not be printed
> Node at 0x000f4fb8 with length 0x0000004a would run over the end of
> the erase block
> Perhaps the file system was created with the wrong erase size?
> jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x000f5000:
> 0x706d instead
> # JFFS2 warning: (563) jffs2_do_read_inode_internal: Truncating ino
> #318 to 62192 bytes failed because it only had 61440 bytes to start
> with!
> JFFS2 warning: (563) jffs2_do_read_inode_internal: Truncating ino #424
> to 7828 bytes failed because it only had 4096 bytes to start with!
> JFFS2 warning: (563) jffs2_do_read_inode_internal: Truncating ino #489 to 11528
> bytes failed because it only had 8192 bytes to start with!
You need to make your driver report 128KiB eraseblock size and emulate
it, then it'll work. It won't work out of the box.
--
Best Regards,
Artem Bityutskiy (Артём Битюцкий)
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-09-07 9:23 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-01 15:36 [RFC] [MTD-utils] mkfs.jffs2: JFFS2 and minimal erase block size Yegor Yefremov
2010-09-02 11:38 ` Artem Bityutskiy
2010-09-07 9:16 ` Yegor Yefremov
2010-09-07 9:21 ` Artem Bityutskiy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).