[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Changing node alignment



Hello,

I'm trying to use JFFS2 on a flash device that supports writes only at
8 byte boundaries. Is there some reason why it would be hard to modify
JFFS2 to write only to addresses divisible by 8? What nontrivial
things would I need to take care of?

I tried to change the definition of PAD() in nodelist.h to round the
argument to the next 8 byte boundary instead of the original 4 byte
boundary, and now when trying to create a few bytes long file on the
fs it's no longer the first write that fails (I get an Eep even before
that however). I also noticed that the 4-byte boundary is somewhat
hardcoded in many places and tried to find and change all the places
in code, with little success so far. I'm currently using the JFFS2
code in the vanilla 2.4.17 kernel.

The relevant pieces from /proc/kmsg are attached below, with the
failing mtd->write() being at the end.

Thanks in advance,

       Sami Liedes


-----

jffs2_lookup()
jffs2_create()
jffs2_reserve_space(): Requested 0x48 bytes
jffs2_reserve_space(): alloc sem got
Eep. Block 0x004a0000 taken from free_list had free_size of 0x0001fff0!!
jffs2_do_reserve_space(): Giving 0x1fff0 bytes at 0x4a0010
jffs2_create(): reserved 0x1fff0 bytes
jffs2_new_inode(): dir_i 1, mode 0x81a4
Allocated inocache at c378e2d4
jffs2_new_inode(): Assigned ino# 2
jffs2_add_ino_cache: Add c378e2d4 (ino #2)
jffs2_write_dnode: ri->totlen (0x00000048) != sizeof(*ri) (0x00000044) +
datalen (0x00000000)
mtd->write(mtd,0x6e0010,68,&retlen,buf)
mtd->write(mtd,0x6e0054,0,&retlen,buf)
jffs2_add_physical_node_ref(): Node at 0x4a0010, size 0x48
jffs2_write_dnode wrote node at 0x004a0010 with dsize 0x0, csize 0x0,
node_crc 0xe96b8b05, data_crc 0x00000000, totlen 0x00000048
jffs2_create created file with mode 0x81a4
jffs2_write_dirent(ino #1, name at *0xc3861f7c "huhuu"->ino #2, name_crc
0xc140feba)
mtd->write(mtd,0x6e0058,40,&retlen,buf)
mtd->write(mtd,0x6e0080,5,&retlen,buf)
jffs2_add_physical_node_ref(): Node at 0x4a0058, size 0x30
jffs2_complete_reservation()
thread_should_wake(): nr_free_blocks 37, nr_erasing_blocks 0, dirty_size 0x0
jffs2_add_fd_to_list( c3af3a00, c378f230 (->00000000))
Dirent "huhuu" (hash 0x11d16857, ino #2
jffs2_create: Created ino #2 with mode 100644, nlink 1(1). nrpages 0
jffs2_prepare_write() nrpages 1
jffs2_do_readpage_nolock(): ino #2, page at offset 0x0
jffs2_readpage: offset 0, end 4096
Filling non-frag hole from 0-4096
readpage finishing
readpage finished
end prepare_write(). nrpages 1
jffs2_commit_write(): ino #2, page at 0x0, range 0-8, nrpages 1
jffs2_commit_write() loop: 0x8 to write to 0x0
jffs2_reserve_space(): Requested 0xc8 bytes
jffs2_reserve_space(): alloc sem got
jffs2_do_reserve_space(): Giving 0x1ff78 bytes at 0x4a0088
mtd->write(mtd,0x6e0088,68,&retlen,buf)
mtd->write(mtd,0x6e00cc,8,&retlen,buf)
mtd: uneven page boundary write
Write of 76 bytes at 0x004a0088 failed. returned 0, retlen 68
jffs2_add_physical_node_ref(): Node at 0x4a0088, size 0x50
jffs2_mark_node_obsolete called with already obsolete node at 0x004a0088
jffs2_complete_reservation()
thread_should_wake(): nr_free_blocks 37, nr_erasing_blocks 0, dirty_size
0x50
jffs2_commit_write(): Not all bytes written. Marking page !uptodate
jffs2_commit_write(): Only 0 bytes written to page. start (0) not reached,
returning -5
jffs2_commit_write() returning -5. nrpages is 1

To unsubscribe from this list: send the line "unsubscribe jffs-dev" in
the body of a message to majordomo@xxxxxxx.com