But I can't figure out the execution sequence of making sure block is
erased before block retiring is called.
You may grep all yaffs_erase_block which is called only inside
yaffs_block_became_dirty or yaffs_retire_block.
But for yaffs_block_became_dirty, here's the code extracted from yaffs_guts.c:
2342 if (!bi->needs_retiring) {
2343 yaffs2_checkpt_invalidate(dev);
2344 erased_ok = yaffs_erase_block(dev, block_no);
2345 if (!erased_ok) {
2346 dev->n_erase_failures++;
2347 yaffs_trace(YAFFS_TRACE_ERROR |
YAFFS_TRACE_BAD_BLOCKS,
2348 "**>> Erasure failed %d", block_no);
2349 }
2350 }
On Thu, Dec 15, 2011 at 2:26 PM, venu <
bvg_1@yahoo.com> wrote:
> Ideally erase operation should happen before marking block as BAD.
> Without that we cannot ensure that the block will be really marked BAD.
>
> ________________________________
> From: zheng shi <neversetsun@gmail.com>
> To: YAFFS <yaffs@lists.aleph1.co.uk>
> Cc: Charles Manning <manningc2@actrix.gen.nz>
> Sent: Thursday, 15 December 2011 11:38 AM
> Subject: [Yaffs] about retiring a block
>
> Hi,
> I found it strange that there's no block erase operation before
> calling yaffs_mark_bad.
> But in mtd_utils/nandwrite.c, the block is erased before marking bad.
>
> Is it the expected behavior?
>
> Thanks!
>
> --
> Regards, Shizheng
>
> _______________________________________________
> yaffs mailing list
> yaffs@lists.aleph1.co.uk
> http://lists.aleph1.co.uk/cgi-bin/mailman/listinfo/yaffs
>
>
--
Regards, Shizheng