Re: [PATCH v3 2/2] mtd: rework partitions handling

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

 



Hi Boris,

> >  int mtd_block_markbad(struct mtd_info *mtd, loff_t ofs)
> >  {
> > -	if (!mtd->_block_markbad)
> > +	struct mtd_info *master = mtd_get_master(mtd);
> > +	int ret;
> > +
> > +	if (!master->_block_markbad)
> >  		return -EOPNOTSUPP;
> >  	if (ofs < 0 || ofs >= mtd->size)
> >  		return -EINVAL;
> >  	if (!(mtd->flags & MTD_WRITEABLE))
> >  		return -EROFS;
> > -	return mtd->_block_markbad(mtd, ofs);
> > +
> > +	ret = master->_block_markbad(master, mtd_get_master_offset(mtd, ofs));
> > +	if (ret)
> > +		return ret;
> > +
> > +	while (mtd->parent) {
> > +		mtd->ecc_stats.badblocks++;
> > +		mtd = mtd->parent;
> > +	}  
> 
> Not exactly related to this patch, but if we mark a block bad on the
> master device this information is not propagated to parts exposing this
> block.

No but is this important? It is very quick to get up to the master
device so the penalty for doing that is almost non-existent.

Other comments addressed, thanks for the review.
Miquèl

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/




[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux