[U-Boot] [PATCH]fix yaffs2 with inband-tags option, mtd_block_markbad & mtd_block_isbad parameter error.

Wolfgang Denk wd at denx.de
Mon Jul 7 14:09:18 CEST 2014


Dear xu.xing1 at zte.com.cn,

In message <OF377CF5DC.91728031-ON48257D0E.001F0CCD-48257D0E.001F38A3 at zte.com.cn> you wrote:
> 
> when I use yaffs2 with inband-tags, the file always miss some part which 
> filled with 0s. 
> 
> It prints 'yaffs: Chunk -1 not found zero instead' when ytrace is 0x800. 
> 
> I found out mtd_block_markbad & mtd_block_isbad parameter is wrong. 
> 
> In file fs\yaffs2\yaffs_guts.c, line 4658 to 4664? 
> 
>         /* Sort out space for inband tags, if required */ 
>         if (dev->param.inband_tags) 
>                 dev->data_bytes_per_chunk = 
>                     dev->param.total_bytes_per_chunk - 
>                     sizeof(struct yaffs_packed_tags2_tags_only); 
>         else 
>                 dev->data_bytes_per_chunk = 
> dev->param.total_bytes_per_chunk; 
> 
> In inband_tags mode, data_bytes_per_chunk is not page aligned, 
> 
> so in file fs\yaffs2\yaffs_mtdif2.c, line 182 to 184 and line 201 to 203, 
> 
>         mtd_block_markbad(mtd, 
>                                blockNo * dev->param.chunks_per_block * 
>                                dev->data_bytes_per_chunk); 
> 
>         mtd_block_isbad(mtd, 
>                              blockNo * dev->param.chunks_per_block * 
>                              dev->data_bytes_per_chunk); 
> 
> the 2nd para is not correct but small. 
> 
> My patch followed, 

Thanks for analyzing the problem.

Please see [1] for the requirements how to format a patch.  Please
make sure to provide a descriptive commit message, and don't forget
your Signed-off-by: line.

Please also check if this fix is still needed with the updated MTD
code as posted by Heiko Schocher [2].  If yes, then I suggest you
rebase your fix against Heiko's code base.

Thanks.

[1] http://www.denx.de/wiki/view/U-Boot/Patches#General_Patch_Submission_Rules
[2] http://article.gmane.org/gmane.comp.boot-loaders.u-boot/189358

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Quote from a recent meeting:   "We are going to continue having these
meetings everyday until I find out why no work is getting done."


More information about the U-Boot mailing list