[PATCH] MTD: treat any negative return value from correct() as an error

Matthew Reimer mreimer at vpop.net
Sat Oct 20 13:59:36 EDT 2007


On Sat, 2007-10-20 at 19:40 +0200, Jörn Engel wrote:
> On Sat, 20 October 2007 09:37:16 -0700, Matt Reimer wrote:
> > 
> > My mistake: I did most of this analysis in the 2.6.21 code, where
> > cafe_ecc.c:cafe_correct_ecc() did return -EIO, not diskonchip.
> > 
> > But as for the rest of the description, I'm just reading the code
> > that's there. An error return from ecc.correct bumps stats.failed,
> > which in nand_do_read_ops does become -EBADMSG:
> > 
> >         if (mtd->ecc_stats.failed - stats.failed)
> >                 return -EBADMSG;
> > 
> >         return  mtd->ecc_stats.corrected - stats.corrected ? -EUCLEAN : 0;
> > 
> > So I was just following what I found there, assuming it was standard practice.
> 
> Fair enough.  Description aside, your patch, my two, plus your patch to
> return -1 on uncorrectable ecc errors instead of 0 should be turned into
> a patch series.  Better yet, change your patch to return -EBADMSG.
> 
> Do you volunteer or should I do it?

I'll do it, if the next couple of days is soon enough. I'd rather keep
you free to work on LogFS. :-)

Matt




More information about the linux-mtd mailing list