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

Writes failing on JFFS2



I've been having some problems updating files on a JFFS2 partition. I
wrote the following simple test script to verify the problem:

#!/bin/sh
I=1
while [ 1 ]; do
    echo "----> $I"
    echo "Run $I " >>/nvram/foo
    I=`expr $I + 1`
done

As you can see, all it does is keep appending to a file in /nvram, which
is our JFFS2 mount point. I run the script after erasing the nvram
partition and after 217 times through the loop the writes to /nvram/foo
start failing. This is very consistent on multiple boards.

The JFFS2 paritition is created with 6 contiguous 64KB sectors. It's
created with the following command:
flash_erase /dev/mtd/5 0 6

I want this partition to be initially empty, so I don't have a
mkfs.jffs2-created file to copy over, but just for completeness I tried
creating one and I got similar results.

I'm running uClinux with the 2.4.22 kernel. To provide more information
I enabled the debugging output in JFFS2, and here's the output around
the time of the error. As you can see, loop 217 writes OK, but loop 218
returns -ENOSPC.

Does anyone have any clues as to what I could be doing wrong here?

Thanks
--Spence


----> 217
jffs2_prepare_write() nrpages 1
end prepare_write(). pg->flags 200cd
jffs2_commit_write(): ino #2, page at 0x0, range 1836-1845, flags 200cd
jffs2_commit_write() loop: 0x735 to write to 0x0
jffs2_reserve_space(): Requested 0xc4 bytes
jffs2_reserve_space(): alloc sem got
jffs2_do_reserve_space(): Giving 0x12c bytes at 0x5fed4
calling deflate with avail_in 220, avail_out 220
deflate returned with avail_in 0, avail_out 145, total_in 220, total_out
75
calling deflate with avail_in 145, avail_out 145
deflate returned with avail_in 0, avail_out 102, total_in 365, total_out
118
calling deflate with avail_in 102, avail_out 102
deflate returned with avail_in 0, avail_out 66, total_in 467, total_out
154
calling deflate with avail_in 66, avail_out 66
deflate returned with avail_in 0, avail_out 37, total_in 533, total_out
183
calling deflate with avail_in 37, avail_out 37
deflate returned with avail_in 0, avail_out 21, total_in 570, total_out
199
calling deflate with avail_in 21, avail_out 21
deflate returned with avail_in 0, avail_out 8, total_in 591, total_out
212
calling deflate with avail_in 8, avail_out 8
deflate returned with avail_in 0, avail_out 1, total_in 599, total_out
219
calling deflate with avail_in 1, avail_out 1
deflate returned with avail_in 0, avail_out 0, total_in 600, total_out
220
zlib compressed 600 bytes into 227
jffs2_add_physical_node_ref(): Node at 0x5fed4, size 0x128
jffs2_write_dnode wrote node at 0x0005fed4 with dsize 0x258, csize 0xe3,
node_crc 0x91f06854
, data_crc 0x2062340c, totlen 0x00000127
jffs2_complete_reservation()
thread_should_wake(): nr_free_blocks 5, nr_erasing_blocks 0, dirty_size
0xfc8c
jffs2_add_full_dnode_to_inode(ino #2, f 9083d3e8, fn 95fb6360)
adding node 0000-0258 @0x0005fed4 on flash, newfrag *95fb9360
j_a_f_d_t_f: dealing with frag 0x0000-0x072c; phys 0x0005fcc4
(*95fb9340->00000000)
Inserting newfrag (*95fb9360) in before 'this' (*95fb9340)
frag 0000-0258: 0x0005fed4 on flash (*95fb9360->95fb9340)
frag 0258-072c: 0x0005fcc4 on flash (*95fb9340->00000000)
increasing writtenlen by 600
jffs2_commit_write() loop: 0x4dd to write to 0x258
jffs2_reserve_space(): Requested 0xc4 bytes
jffs2_reserve_space(): alloc sem got
Adding full erase block at 0x00050000 to dirty_list (free 0x00000000,
dirty 0x0000fc90, used
 0x00000370
jffs2_do_reserve_space(): Giving 0xfff4 bytes at 0x4000c
calling deflate with avail_in 1233, avail_out 1233
deflate returned with avail_in 0, avail_out 961, total_in 1233,
total_out 272
calling deflate with avail_in 12, avail_out 961
deflate returned with avail_in 0, avail_out 953, total_in 1245,
total_out 280
zlib compressed 1245 bytes into 286
jffs2_add_physical_node_ref(): Node at 0x4000c, size 0x164
jffs2_write_dnode wrote node at 0x0004000c with dsize 0x4dd, csize
0x11e, node_crc 0x38d4f66
9, data_crc 0x53f1ba2b, totlen 0x00000162
jffs2_complete_reservation()
thread_should_wake(): nr_free_blocks 4, nr_erasing_blocks 0, dirty_size
0xfc90
jffs2_add_full_dnode_to_inode(ino #2, f 9083d3e8, fn 95fb6350)
adding node 0258-0735 @0x0004000c on flash, newfrag *95fb9350
j_a_f_d_t_f: skipping frag 0x0000-0x0258; phys 0x0005fed4
(*95fb9360->95fb9340)
j_a_f_d_t_f: dealing with frag 0x0258-0x072c; phys 0x0005fcc4
(*95fb9340->00000000)
Inserting newfrag (*95fb9350) in before 'this' (*95fb9340)
Marking old node @0x0005fcc4 (0x0000-0x072c) obsolete
obliterating obsoleted node at 0x0005fcc4
frag 0000-0258: 0x0005fed4 on flash (*95fb9360->95fb9350)
frag 0258-0735: 0x0004000c on flash (*95fb9350->00000000)
increasing writtenlen by 1245
jffs2_commit_write() returning 9. nrpages is 1
----> 218
jffs2_prepare_write() nrpages 1
end prepare_write(). pg->flags 200cd
jffs2_commit_write(): ino #2, page at 0x0, range 1845-1854, flags 200cd
jffs2_commit_write() loop: 0x73e to write to 0x0
jffs2_reserve_space(): Requested 0xc4 bytes
jffs2_reserve_space(): alloc sem got
Short on space, but total dirty size 0x0000fea0 < sector size
0x00010000, so -ENOSPC
jffs2_reserve_space returned -28
jffs2_commit_write(): Not all bytes written. Marking page !uptodate
jffs2_commit_write(): Only 0 bytes written to page. start (735) not
reached, returning -28
jffs2_commit_write() returning 9. nrpages is 1


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