On Thu, Jun 23, 2011 at 04:12, Andrea Gasparini <gasparini@imavis.com> wrote:

is the issue I found and posted a little ago. I never found the time to
correctly send a description of what I found.

In the old version sometimes the size of the block (to be clear the field:
yaffs_packed_tags2_tags_only.n_bytes) isn't written (don't know if it's a
bug or a feature....) while the new check there's a correct size even if
isn't used.

Mark: could you please try to apply this? *IT'S NOT* the right solution,
but just to understand what your problem is.

diff --git a/fs/yaffs2/yaffs_yaffs2.c b/fs/yaffs2/yaffs_yaffs2.c
index 5761e96..5382e02 100644
--- a/fs/yaffs2/yaffs_yaffs2.c
+++ b/fs/yaffs2/yaffs_yaffs2.c
@@ -1024,8 +1024,7 @@ static inline int yaffs2_scan_chunk(struct yaffs_dev
*dev,
       } else if (tags.obj_id > YAFFS_MAX_OBJECT_ID ||
                  tags.chunk_id > YAFFS_MAX_CHUNK_ID ||
                  tags.obj_id == YAFFS_OBJECTID_SUMMARY ||
-                  (tags.chunk_id > 0 &&
-                    tags.n_bytes > dev->data_bytes_per_chunk) ||
+                  //(tags.chunk_id > 0 && tags.n_bytes > dev-
>data_bytes_per_chunk) ||
                  tags.seq_number != bi->seq_number) {
               yaffs_trace(YAFFS_TRACE_SCAN,
                       "Chunk (%d:%d) with bad tags:obj = %d, chunk_id =
%d, n_bytes = %d, ignored"


Thanks Andrea,

I applied the patch to the new tree and got the same result.  I also enabled additional msgs in the yaffs_trace_mask.  I created the /mnt/card/testdata in the same manner as before and here is the output from the new yaffs2 fs with the patch:


root@homebase:~# mount -t yaffs2 /dev/mtdblock5 /mnt/card/
yaffs: dev is 32505861 name is "mtdblock5" rw
yaffs: passed flags ""
ixed ECC in chunk(17:38), chunk ignored
packed tags obj 261 chunk 868 byte 2048 seq 4110
packed tags obj 261 chunk 804 byte 2048 seq 4109
packed tags obj 261 chunk 676 byte 2048 seq 4107
21 data (null) tags cee65db0
29 data (null) tags cee65db0
65 data (null) tags cee65db0
root@homebase:~# cat /proc/yaffs
Multi-version YAFFS built:Jun 23 2011 10:32:11


Device 0 "system_a"
start_block.......... 0
end_block............ 785
total_bytes_per_chunk 2048
use_nand_ecc......... 1
no_tags_ecc.......... 0
is_yaffs2............ 1
inband_tags.......... 0
empty_lost_n_found... 1
disable_lazy_load.... 0
refresh_period....... 500
n_caches............. 10
n_reserved_blocks.... 5
always_check_erased.. 0

data_bytes_per_chunk. 2048
chunk_grp_bits....... 0
chunk_grp_size....... 1
n_erased_blocks...... 785
blocks_in_checkpt.... 0

n_tnodes............. 0
n_obj................ 4
n_free_chunks........ 50304

n_page_writes........ 0
n_page_reads......... 64
n_erasures........... 1
n_gc_copies.......... 0
all_gcs.............. 1
passive_gc_count..... 1
oldest_dirty_gc_count 0
n_gc_blocks.......... 0
bg_gcs............... 0
n_retired_writes..... 0
n_retired_blocks..... 0
n_ecc_fixed.......... 0
n_ecc_unfixed........ 0
n_tags_ecc_fixed..... 0
n_tags_ecc_unfixed... 0
cache_hits........... 0
n_deleted_files...... 0
n_unlinked_files..... 1
refresh_count........ 1
n_bg_deletions....... 0
tags_used............ 1536
summary_used......... 0
root@homebase:~# ls -/mnt/card/l/mnt/card/ /mnt/card//mnt/card/
drwx------    1 root     root          2048 Jun 23 15:20 lost+found
root@homebase:~# root@homebase:~# ls -l /mnt/card/losroot@homebase:~# ls -l /mnt/card/lost\+found/
root@homebase:~# 


testdata still missing.

Thanks a lot for your help.  Would it be helpful to look at a nanddump of the partition written using old yaffs?  I can also build the old yaffs2 kernel with the additional trace msgs. 

 
bye
--
Andrea Gasparini
---- ImaVis S.r.l. ----
web: www.imavis.com