* two issues about summary patch
@ 2005-04-12 2:03 Jiang Jun-A21079
2005-04-12 8:59 ` Ferenc Havasi
2005-04-13 12:47 ` Ferenc Havasi
0 siblings, 2 replies; 6+ messages in thread
From: Jiang Jun-A21079 @ 2005-04-12 2:03 UTC (permalink / raw)
To: MTD List; +Cc: Gu Susan-w15879
Our jffs2 is taken from MontaVista 3.1, and summary patch downloaded from website http://www.inf.u-szeged.hu/jffs2/mount.php
And we use NOR flash in our product.
First issue:
The scenario is: write a lot of data into a newly create file in JFFS2, then suddenly power down the phone, at next time power on, during mounting of this JFFS2 filesystem, below info is printed out:
T[248]Eep. Child "download" (ino #3) of dir ino #1 doesn't exist!
T[249]Eep. Child "download_modules" (ino #19) of dir ino #1 doesn't exist! T[250]Eep. Child ".check" (ino #2) of dir ino #1 doesn't exist!
T[250]Eep. Child "etc_files" (ino #20) of dir ino #1 doesn't exist!
T[251]Eep. Child ".check_db" (ino #22) of dir ino #1 doesn't exist!
T[252]jffs2_do_read_inode() on nonexistent ino 22
Function jffs2_sum_add_kvec() will be called by function jffs2_flash_direct_writev() in writev.c. It will add summary information into jeb->sum_collected before writing data into flash, But if we write data with function jffs2_flash_write(). It will bypass summary information. In our NOR flash case. Jffs2_flash_write() be defined with c->mtd->write().jffs2_flash_write() be called in gc.c and nodemgmt.c. in gc.c when we garbage collected pristine node, jffs2_flash_write() will be call without summary information handled. We will lose summary information of that pristine node at next power on. I think function jffs2_flash_write() in wbuf.c is better than c->mtd->write(). It will handle summary information through jffs2_flash_writev().
With jffs2_flash_write() in nodemgmt.c, if node has been obsolete, should we remove its summary information too?
Second issue:
The scenario is: write a lot of data into a newly create file in JFFS2, when a eraseblock is full, then power down the phone. After system restarted we can't write anything to this partition. Any write will hang system.
In our power failure test, a case is write data to flash until a erasebock is full, at this time last dnode has been wrote into this block, but summary information of this block has not been wrote. It would be write in next write requirement. In the function jffs2_write_inode_range, test case will stop system behind statement "jffs2_write_dnode()" if it found the space jffs2_reserve_space() reserved is less then variable datalen.
We found jffs2 will call jffs2_do_reserve_space() before any writing action. In this function variable len is equal jeb->free_size reduce nofree_size.
But nofree_size is not on 4 bytes boundary, so the len is not on 4 bytes boundary too.
When system restart and scanning this full block, any node scanned will call one of USED_SPACE , UNCHECKED_SPACE, DIRTY_SPACE and WASTED_SPACE
Four macro listed above will pad its parameter before handling. So, after last node be scanned and before actual space on flash remain for summary information. Jeb->free_size has been pad to 4 bytes boundary. The statement "if (jeb->sum_collected->sum_size + JFFS2_SUMMARY_FRAME_SIZE > jeb->free_size)" in function jffs2_scan_eraseblock() will be TRUE, then it clear members of ieb->sum_collected. Any write will call jffs2_sum_write_sumnode (c) in function jffs2_do_reserve_space. But members of jeb->sum_collected has been cleared. So system will hang up.
We want to remove jeb->sum_collected check from jffs2_scan_eraseblock() or add statement "nofree_size = PAD(nofree_size)" behind statement "nofree_size = sumsize + jeb->sum_collected->sum_size + JFFS2_SUMMARY_FRAME_SIZE" in function jffs2_do_reserve_space().Macro JFFS2_SUMMARY_FRAME_SIZE need not plus 3 for 4 bytes boundary.
Best regards
kevin
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: two issues about summary patch
2005-04-12 2:03 two issues about summary patch Jiang Jun-A21079
@ 2005-04-12 8:59 ` Ferenc Havasi
2005-04-12 15:33 ` Steven Scholz
2005-04-13 12:47 ` Ferenc Havasi
1 sibling, 1 reply; 6+ messages in thread
From: Ferenc Havasi @ 2005-04-12 8:59 UTC (permalink / raw)
To: Jiang Jun-A21079; +Cc: Gu Susan-w15879, MTD List
Hi Kevin,
Thank you very much for your feedback. We will fix these problems very
soon and update the summary patch and JFFS3, too.
Ferenc
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: two issues about summary patch
2005-04-12 8:59 ` Ferenc Havasi
@ 2005-04-12 15:33 ` Steven Scholz
2005-04-12 22:48 ` Ferenc Havasi
2005-04-14 9:21 ` Ferenc Havasi
0 siblings, 2 replies; 6+ messages in thread
From: Steven Scholz @ 2005-04-12 15:33 UTC (permalink / raw)
To: MTD List
Hi Ferenc,
> Thank you very much for your feedback. We will fix these problems very
> soon and update the summary patch and JFFS3, too.
Will you announce a new summary patch (for JFFS2) here?
Or do we have to poll your web site?
--
Steven
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: two issues about summary patch
2005-04-12 15:33 ` Steven Scholz
@ 2005-04-12 22:48 ` Ferenc Havasi
2005-04-14 9:21 ` Ferenc Havasi
1 sibling, 0 replies; 6+ messages in thread
From: Ferenc Havasi @ 2005-04-12 22:48 UTC (permalink / raw)
To: Steven Scholz; +Cc: MTD List
Hi Steven,
> Will you announce a new summary patch (for JFFS2) here?
> Or do we have to poll your web site?
OK, we will announce new versions here.
Bye,
Ferenc
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: two issues about summary patch
2005-04-12 2:03 two issues about summary patch Jiang Jun-A21079
2005-04-12 8:59 ` Ferenc Havasi
@ 2005-04-13 12:47 ` Ferenc Havasi
1 sibling, 0 replies; 6+ messages in thread
From: Ferenc Havasi @ 2005-04-13 12:47 UTC (permalink / raw)
To: Jiang Jun-A21079
Cc: Gyimóthy Tibor, Gu Susan-w15879, MTD List,
Sógor Zoltán
Hi Kevin,
We've investigated you issues about summary patch.
The second one (wrong padding) is OK, you was right, we've fixed it, the
new patch will be released soon.
But we have some questions according the first issue:
> Function jffs2_sum_add_kvec() will be called by function jffs2_flash_direct_writev() in writev.c. It will add summary information into jeb->sum_collected before writing data into flash, But if we write data with function jffs2_flash_write(). It will bypass summary information. In our NOR flash case. Jffs2_flash_write() be defined with c->mtd->write().jffs2_flash_write() be called in gc.c and nodemgmt.c. in gc.c when we garbage collected pristine node, jffs2_flash_write() will be call without summary information handled. We will lose summary information of that pristine node at next power on. I think function jffs2_flash_write() in wbuf.c is better than c->mtd->write(). It will handle summary information through jffs2_flash_writev().
>With jffs2_flash_write() in nodemgmt.c, if node has been obsolete, should we remove its summary information too?
>
>
Are you sure that you used the latest version of summary patch? It was a
problem before 20050117, but now it should work.
If summary is enabled jffs2_can_mark_obsolete(c) is set to false (in
os-linux.h). Becauseof it the node will not be obsolated by setting the
node accurate bit, so we don't need to delete its summary information.
If summary support is enabled jffs2_flash_write() will be not called by
anyone. In jffs2_mark_node_obsolate() it will return before calling
jffs2_flash_write() because jffs2_can_mark_obsolete(c) is set to false:
if (!jffs2_can_mark_obsolete(c) || jffs2_is_readonly(c) ||
(c->flags & JFFS2_SB_FLAG_BUILDING)) {
/* We didn't lock the erase_free_sem */
return;
}
In gc.c the patches after 20050117 replace jffs2_flash_write() to
jffs2_flash_writev().
Regards,
Ferenc
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: two issues about summary patch
2005-04-12 15:33 ` Steven Scholz
2005-04-12 22:48 ` Ferenc Havasi
@ 2005-04-14 9:21 ` Ferenc Havasi
1 sibling, 0 replies; 6+ messages in thread
From: Ferenc Havasi @ 2005-04-14 9:21 UTC (permalink / raw)
To: Steven Scholz; +Cc: MTD List
Dear All,
> Will you announce a new summary patch (for JFFS2) here?
> Or do we have to poll your web site?
The new summary patch version is released. JFFS3 is also updated. There
is only a small fix related to Kevin's second issue (PAD-ing).
Bye,
Ferenc
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2005-04-14 9:20 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-04-12 2:03 two issues about summary patch Jiang Jun-A21079
2005-04-12 8:59 ` Ferenc Havasi
2005-04-12 15:33 ` Steven Scholz
2005-04-12 22:48 ` Ferenc Havasi
2005-04-14 9:21 ` Ferenc Havasi
2005-04-13 12:47 ` Ferenc Havasi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox