[Yaffs] yaffs_ScanBackwards may miss written blocks whose fi…

トップ ページ
添付ファイル:
Eメールのメッセージ
+ (text/plain)
このメッセージを削除
このメッセージに返信
著者: zheng shi
日付:  
To: YAFFS
CC: Charles Manning
題目: [Yaffs] yaffs_ScanBackwards may miss written blocks whose first chunks fail "yaffs_CheckChunkErased"
Hi,

In yaffs_WriteNewChunkWithTagsToNAND, write retry will happen when
yaffs_CheckChunkErased fails.
If the first chunk of an erased block fails this check, later chunks
of this block will still
get allocated and written. But the first chunk still remains an unused
status. So during next
mount, yaffs_ScanBackwards will ignore these written blocks.

I suggest a patch like:

    if (!bi->skipErasedCheck) {
        erasedOk = yaffs_CheckChunkErased(dev, chunk);
        if (erasedOk != YAFFS_OK) {
            T(YAFFS_TRACE_ERROR,
            (TSTR ("**>> yaffs chunk %d was not erased"
            TENDSTR), chunk));
+
+            if(chunk%dev->nChunksPerBlock == 0){
+                yaffs_HandleChunkError( dev, i);
+                dev->allocationBlock = -1;
+            }


            /* try another chunk */
            continue;
        }
        bi->skipErasedCheck = 1;
    }




--
Regards, neversetsun