About commit [86cf34] - Handle more bad block during mount

102 views
Skip to first unread message

Savin Zlobec

unread,
Oct 25, 2013, 7:13:32 AM10/25/13
to UFFS
Hi Ricky,

I am just looking at your latest git changes. Shouldn't some of the new
bad block checks in uffs_tree.c verify that the block in pending list is
really a bad block (mark == UFFS_PENDING_BLK_RECOVER) before marking
it as such?

David Luca

unread,
Jan 16, 2015, 4:01:05 AM1/16/15
to uf...@googlegroups.com
Hi,

I noticed too that if there is power failure then bad blocks keep adding up and there is no attempt to recover them. They go away if I format the flash though. 
This is the log that I have with code built from master:
Uffs mem : @82 - System static memory: 36464 bytes
Uffs mtb : @174 - init device for mount point / ...
Uffs mtb : @193 - mount partiton: 0,1023
Uffs mem : @66 - 0x0xd0028728: Allocated 160, free 36304
Uffs flsh: @216 - alloc spare buffers 160 bytes.
Uffs flsh: @244 - ECC size 3
Uffs flsh: @292 - UFFS consume spare data size 13
Uffs init: @113 - init page buf
Uffs mem : @66 - 0x0xd00287c8: Allocated 5600, free 30704
Uffs pbuf: @248 - alloc 5600 bytes.
Uffs init: @119 - init block info cache
Uffs mem : @66 - 0x0xd0029da8: Allocated 14000, free 16704
Uffs bc  : @95 - alloc info cache 14000 bytes.
Uffs mem : @66 - 0x0xd002d458: Allocated 16384, free 320
Uffs tree: @95 - alloc tree nodes 16384 bytes.
Uffs tree: @524 - build tree step one
Uffs tree: @545 - found bad block 99
Uffs tree: @545 - found bad block 118
Uffs tree: @545 - found bad block 218
Uffs tree: @545 - found bad block 223
Uffs tree: @545 - found bad block 293
Uffs tree: @545 - found bad block 321
Uffs tree: @545 - found bad block 411
Uffs tree: @545 - found bad block 416
Uffs tree: @489 - unclean page found, block 431 page 8
Uffs bbl : @331 - Add pending block 431 - Cleanup
Uffs tree: @597 - New bad block (431) discovered.
Uffs flsh: @779 - Mark bad block: 431
Uffs bbl : @364 - pending block 431 removed
Uffs tree: @545 - found bad block 462
Uffs tree: @545 - found bad block 496
Uffs tree: @545 - found bad block 500
Uffs tree: @545 - found bad block 510
Uffs tree: @545 - found bad block 548
Uffs tree: @545 - found bad block 563
Uffs tree: @614 - DIR 0, FILE 8, DATA 345
Uffs tree: @626 - build tree step two
Uffs tree: @1044 - build tree step three

I believe a new bad block is marked as bad after _ScanAndFixUnCleanPage function is executed and removed from pending list and then the next check after _BuiltTreeStepOne finds an empty list.
uffs_tree.c, line 1108:
                 if (HAVE_BADBLOCK(dev))
           uffs_BadBlockRecover(dev);

Best regards,
David.
Message has been deleted

Ricky

unread,
Jan 24, 2015, 5:25:37 PM1/24/15
to uf...@googlegroups.com
Yes it's bug, it should be fixed in commit 

6149378161f6ebcc638c0e147fd2e6d89d786c70

Regards,
Ricky
Reply all
Reply to author
Forward
0 new messages