# HG changeset patch # User marty # Date 1133297672 0 # Node ID 154a271837623ee068bcff58e70276b501686838 # Parent 0e8b8a6952789547faa6e43e39722eb1e891fc1e Subject: [Yaffs] Avoid tagsEccUnfixed stats bump on mounting partially usedblock IIUC, yaffs1 compatibility mode checks tags ECCs and updates stats on tags ECC errors when scanning an unused chunk of a partially-allocated block at mount time. This causes a mildly alarming "tagsEccUnfixed..... 1" in /proc/yaffs. Suggested fix below. Signed-off-by: Todd Poynor diff --git a/yaffs_tagscompat.c b/yaffs_tagscompat.c --- a/yaffs_tagscompat.c +++ b/yaffs_tagscompat.c @@ -455,20 +455,22 @@ int yaffs_TagsCompatabilityReadChunkWith int deleted = (yaffs_CountBits(spare.pageStatus) < 7) ? 1 : 0; - yaffs_GetTagsFromSpare(dev, &spare, &tags); - eTags->chunkDeleted = deleted; - eTags->objectId = tags.objectId; - eTags->chunkId = tags.chunkId; - eTags->byteCount = tags.byteCount; - eTags->serialNumber = tags.serialNumber; eTags->eccResult = eccResult; eTags->blockBad = 0; /* We're reading it */ /* therefore it is not a bad block */ - eTags->chunkUsed = (memcmp(&spareFF, &spare, sizeof(spareFF)) != 0) ? 1 : 0; + + if (eTags->chunkUsed) { + yaffs_GetTagsFromSpare(dev, &spare, &tags); + + eTags->objectId = tags.objectId; + eTags->chunkId = tags.chunkId; + eTags->byteCount = tags.byteCount; + eTags->serialNumber = tags.serialNumber; + } } return YAFFS_OK;