Re: [Yaffs] [PATCH] Fix order of block state names

Página superior
Adjuntos:
Obtener este mensaje como un correo
+ (text/plain)
+ (text/html)
Eliminar este mensaje
Responder a este mensaje
Autor: Charles Manning
Fecha:  
A: Cory Wiltshire
Cc: yaffs
Asunto: Re: [Yaffs] [PATCH] Fix order of block state names
Hi Corey

Thank you very much for pointing out this bug.

I have used the following patch instead to prevent there being any future

Author: Charles Manning <>
Date: Wed May 26 10:45:13 2021 +1200

    Index the block state string list because the order was wrong.


    Thanks to Cory Wiltshire for pointing out the problem and proposing
    a fix.


    Signed-off-by: Charles Manning <>


diff --git a/yaffs_verify.c b/yaffs_verify.c
index ba9b9f4..e634b50 100644
--- a/yaffs_verify.c
+++ b/yaffs_verify.c
@@ -36,16 +36,16 @@ static int yaffs_skip_nand_verification(struct
yaffs_dev *dev)
}

 static const char * const block_state_name[] = {
-       "Unknown",
-       "Needs scan",
-       "Scanning",
-       "Empty",
-       "Allocating",
-       "Full",
-       "Dirty",
-       "Checkpoint",
-       "Collecting",
-       "Dead"
+       [YAFFS_BLOCK_STATE_UNKNOWN] = "Unknown",
+       [YAFFS_BLOCK_STATE_NEEDS_SCAN] = "Needs scan",
+       [YAFFS_BLOCK_STATE_SCANNING] = "Scanning",
+       [YAFFS_BLOCK_STATE_EMPTY] = "Empty",
+       [YAFFS_BLOCK_STATE_ALLOCATING] = "Allocating",
+       [YAFFS_BLOCK_STATE_FULL] = "Full",
+       [YAFFS_BLOCK_STATE_DIRTY] = "Dirty",
+       [YAFFS_BLOCK_STATE_CHECKPOINT] = "Checkpoint",
+       [YAFFS_BLOCK_STATE_COLLECTING] = "Collecting",
+       [YAFFS_BLOCK_STATE_DEAD] = "Dead"
 };




Thanks

Regards

Charles


On Fri, May 21, 2021 at 5:56 AM Cory Wiltshire <> wrote:

> ping
>
> On Mon, Jun 15, 2020 at 10:41 PM Cory Wiltshire <> wrote:
>
>> YAFFS_BLOCK_STATE_SCANNING is defined before YAFFS_BLOCK_STATE_NEEDS_SCAN
>> in the enum definition for yaffs_block_state in yaffs_guts.h
>> This fixes the block_state_name array in yaffs_verify.c to match.
>> ---
>> yaffs_verify.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/yaffs_verify.c b/yaffs_verify.c
>> index 9141eb5..8bfed19 100644
>> --- a/yaffs_verify.c
>> +++ b/yaffs_verify.c
>> @@ -37,8 +37,8 @@ static int yaffs_skip_nand_verification(struct
>> yaffs_dev *dev)
>>
>>  static const char * const block_state_name[] = {
>>         "Unknown",
>> -       "Needs scan",
>>         "Scanning",
>> +       "Needs scan",
>>         "Empty",
>>         "Allocating",
>>         "Full",
>> --
>> 2.17.1

>>
>
>
>
> ________
> This email and any attachments may contain Astranis confidential and/or
> proprietary information governed by a non-disclosure agreement, and are
> intended solely for the individual or entity specified by the message.
> _______________________________________________
> yaffs mailing list
>
> http://stoneboat.aleph1.co.uk/cgi-bin/mailman/listinfo/yaffs
>