Hi,
I have a problem using yaffs2 (on a NAND with small pages)
If I do the following operation:
flash_eraseall /dev/mtd3
mount -t yaffs /dev/mtdblock3 DFS
cd DFS
touch toto
rm toto
sync
touch toto
rm toto
sync
cd ..
umount DFS
mount -t yaffs /dev/mtdblock3 DFS
cd DFS
ls
The last ls command give me this:
lost+found toto toto
The file 'toto' should have been erased but it is here twice ! It seams
there is a problem with the 'rm' operation ! My original objective is to be
resistant to power failure. I originally tested these operations without
unmounting the fs, and of course the result is the same.
I was originnaly using a yaffs2 version from end of 2007. I have updated it
to the current CVS version. I have the same problem with the two versions.
Do you have any idea of the origin of the problem ?
Here is all the procedure with complete yaffs logs:
# flash_eraseall /dev/mtd3
Erasing 16 Kibyte @ ffc000 -- 99 % complete.
# mount -t yaffs /dev/mtdblock3 DFS
yaffs: dev is 32505859 name is "mtdblock3"
yaffs: passed flags ""
yaffs_read_super: Using yaffs1
yaffs_read_super: block size 4096
yaffs: Attempting MTD mount on 31.3, "mtdblock3"
erase c01518bc
read c0151344
write c015168c
readoob c0151508
writeoob c0151744
block_isbad c0151ae4
block_markbad c0151b38
writesize 512
oobsize 16
erasesize 16384
size 16777216
yaffs locking
yaffs: yaffs_GutsInitialise()
yaffs_Scan starts intstartblk 1 intendblk 1024...
Block scanning block 1 state 3 seq 0
Block empty
Block scanning block 2 state 3 seq 0
Block empty
Block scanning block 3 state 3 seq 0
Block empty
Block scanning block 4 state 3 seq 0
Block empty
Block scanning block 5 state 3 seq 0
Block empty
Block scanning block 6 state 3 seq 0
Block empty
Block scanning block 7 state 3 seq 0
Block empty
Block scanning block 8 state 3 seq 0
Block empty
Block scanning block 9 state 3 seq 0
Block empty
Block scanning block 10 state 3 seq 0
Block empty
Block scanning block 11 state 3 seq 0
Block empty
Block scanning block 12 state 3 seq 0
Block empty
Block scanning block 13 state 3 seq 0
Block empty
[...]
Block scanning block 1018 state 3 seq 0
Block empty
Block scanning block 1019 state 3 seq 0
Block empty
Block scanning block 1020 state 3 seq 0
Block empty
Block scanning block 1021 state 3 seq 0
Block empty
Block scanning block 1022 state 3 seq 0
Block empty
Block scanning block 1023 state 3 seq 0
Block empty
Block scanning block 1024 state 3 seq 0
Block empty
yaffs_Scan ends
Block summary
0 blocks have illegal states
Unknown 0 blocks
Needs scanning 0 blocks
Scanning 0 blocks
Empty 1024 blocks
Allocating 0 blocks
Full 0 blocks
Dirty 0 blocks
Checkpoint 0 blocks
Collecting 0 blocks
Dead 0 blocks
yaffs: yaffs_GutsInitialise() done.
yaffs_read_super: guts initialised OK
yaffs unlocking
yaffs_get_inode for object 1
yaffs_read_inode for 1
yaffs locking
yaffs_FillInode mode 41b6 uid 0 gid 0 size 512 count 1
yaffs unlocking
yaffs_read_super: got root inode
yaffs_read_super: d_alloc_root done
yaffs_read_super: done
# cd DFS/
# touch toto
yaffs locking
yaffs_lookup for 1:toto
yaffs unlocking
yaffs_lookup not found
yaffs_create
yaffs_mknod: parent object 1 type 3
yaffs_mknod: making oject for toto, mode 81a4 dev 0
yaffs locking
yaffs_mknod: making file
yaffs: Tnodes added
Allocated block 1, seq 4097, 1023 left
Writing chunk 0 tags 274 0
yaffs unlocking
yaffs_get_inode for object 274
yaffs_read_inode for 274
yaffs locking
yaffs_FillInode mode 81a4 uid 0 gid 0 size 0 count 1
yaffs unlocking
yaffs_mknod created object 274 count = 1
yaffs_file_flush object 274 (clean)
yaffs locking
yaffs unlocking
# rm toto
yaffs_unlink 1:toto
yaffs locking
Obj 0 header mismatch objectId 274
Writing chunk 1 tags 274 0
line 3727 delete of chunk 32
Writing chunk 0 tags 0 0
yaffs unlocking
yaffs_put_inode: ino 274, count 2
yaffs_put_inode: ino 274, count 1
yaffs_delete_inode: ino 274, count 0 object exists
yaffs locking
line 5069 delete of chunk 33
Writing chunk 1 tags 0 0
yaffs unlocking
yaffs_clear_inode: ino 274, count 0 object exists
yaffs locking
yaffs unlocking
# sync
yaffs_sync_fs
yaffs_sync_fs
# touch toto
yaffs_create
yaffs_mknod: parent object 1 type 3
yaffs_mknod: making oject for toto, mode 81a4 dev 0
yaffs locking
yaffs_mknod: making file
Writing chunk 2 tags 275 0
yaffs unlocking
yaffs_get_inode for object 275
yaffs_read_inode for 275
yaffs locking
yaffs_FillInode mode 81a4 uid 0 gid 0 size 0 count 1
yaffs unlocking
yaffs_mknod created object 275 count = 1
yaffs_file_flush object 275 (clean)
yaffs locking
yaffs unlocking
# rm toto
yaffs_unlink 1:toto
yaffs locking
Obj 0 header mismatch objectId 275
Writing chunk 3 tags 275 0
line 3727 delete of chunk 34
Writing chunk 2 tags 0 0
yaffs unlocking
yaffs_put_inode: ino 275, count 2
yaffs_put_inode: ino 275, count 1
yaffs_delete_inode: ino 275, count 0 object exists
yaffs locking
line 5069 delete of chunk 35
Writing chunk 3 tags 0 0
yaffs unlocking
yaffs_clear_inode: ino 275, count 0 object exists
yaffs locking
yaffs unlocking
# sync
yaffs_sync_fs
yaffs_sync_fs
# cd ..
# umount DFS/
yaffs_put_inode: ino 1, count 1
yaffs_sync_fs
yaffs_clear_inode: ino 1, count 0 object exists
yaffs locking
yaffs unlocking
yaffs_put_super
yaffs locking
save entry: isCheckpointed 0
Block summary
0 blocks have illegal states
Unknown 0 blocks
Needs scanning 0 blocks
Scanning 0 blocks
Empty 1023 blocks
Allocating 1 blocks
Full 0 blocks
Dirty 0 blocks
Checkpoint 0 blocks
Collecting 0 blocks
Dead 0 blocks
skipping checkpoint write
checkpoint byte count 0
save exit: isCheckpointed 0
yaffs unlocking
# mount -t yaffs /dev/mtdblock3 DFS
yaffs: dev is 32505859 name is "mtdblock3"
yaffs: passed flags ""
yaffs_read_super: Using yaffs1
yaffs_read_super: block size 4096
yaffs: Attempting MTD mount on 31.3, "mtdblock3"
erase c01518bc
read c0151344
write c015168c
readoob c0151508
writeoob c0151744
block_isbad c0151ae4
block_markbad c0151b38
writesize 512
oobsize 16
erasesize 16384
size 16777216
yaffs locking
yaffs: yaffs_GutsInitialise()
yaffs_Scan starts intstartblk 1 intendblk 1024...
Block scanning block 1 state 2 seq 68
Block scanning block 2 state 3 seq 0
Block empty
Block scanning block 3 state 3 seq 0
Block empty
Block scanning block 4 state 3 seq 0
Block empty
Block scanning block 5 state 3 seq 0
Block empty
Block scanning block 6 state 3 seq 0
Block empty
Block scanning block 7 state 3 seq 0
Block empty
Block scanning block 8 state 3 seq 0
Block empty
Block scanning block 9 state 3 seq 0
Block empty
Block scanning block 10 state 3 seq 0
Block empty
Block scanning block 11 state 3 seq 0
Block empty
Block scanning block 12 state 3 seq 0
Block empty
[...]
Block scanning block 1002 state 3 seq 0
Block empty
Block scanning block 1003 state 3 seq 0
Block empty
Block scanning block 1004 state 3 seq 0
Block empty
Block scanning block 1005 state 3 seq 0
Block empty
Block scanning block 1006 state 3 seq 0
Block empty
Block scanning block 1007 state 3 seq 0
Block empty
Block scanning block 1008 state 3 seq 0
Block empty
Block scanning block 1009 state 3 seq 0
Block empty
Block scanning block 1010 state 3 seq 0
Block empty
Block scanning block 1011 state 3 seq 0
Block empty
Block scanning block 1012 state 3 seq 0
Block empty
Block scanning block 1013 state 3 seq 0
Block empty
Block scanning block 1014 state 3 seq 0
Block empty
Block scanning block 1015 state 3 seq 0
Block empty
Block scanning block 1016 state 3 seq 0
Block empty
Block scanning block 1017 state 3 seq 0
Block empty
Block scanning block 1018 state 3 seq 0
Block empty
Block scanning block 1019 state 3 seq 0
Block empty
Block scanning block 1020 state 3 seq 0
Block empty
Block scanning block 1021 state 3 seq 0
Block empty
Block scanning block 1022 state 3 seq 0
Block empty
Block scanning block 1023 state 3 seq 0
Block empty
Block scanning block 1024 state 3 seq 0
Block empty
yaffs: Tnodes added
line 5660 delete of chunk 33
Writing chunk 1 tags 0 0
line 5660 delete of chunk 35
Writing chunk 3 tags 0 0
Allocating from 1 4
yaffs_Scan ends
Block summary
0 blocks have illegal states
Unknown 0 blocks
Needs scanning 0 blocks
Scanning 0 blocks
Empty 1023 blocks
Allocating 1 blocks
Full 0 blocks
Dirty 0 blocks
Checkpoint 0 blocks
Collecting 0 blocks
Dead 0 blocks
yaffs: yaffs_GutsInitialise() done.
yaffs_read_super: guts initialised OK
yaffs unlocking
yaffs_get_inode for object 1
yaffs_read_inode for 1
yaffs locking
yaffs_FillInode mode 41b6 uid 0 gid 0 size 512 count 1
yaffs unlocking
yaffs_read_super: got root inode
yaffs_read_super: d_alloc_root done
yaffs_read_super: done
# cd DFS/
# ls
yaffs locking
yaffs_readdir: starting at 0
yaffs_readdir: entry . ino 1
yaffs_readdir: entry .. ino 1
yaffs_readdir: toto inode 275
yaffs_readdir: toto inode 274
yaffs_readdir: lost+found inode 2
yaffs unlocking
yaffs locking
yaffs_lookup for 1:toto
yaffs unlocking
yaffs_lookup found 275
yaffs_get_inode for object 275
yaffs_read_inode for 275
yaffs locking
yaffs_FillInode mode 81a4 uid 0 gid 0 size 0 count 1
yaffs unlocking
yaffs_loookup dentry
yaffs locking
yaffs_lookup for 1:lost+found
yaffs unlocking
yaffs_lookup found 2
yaffs_get_inode for object 2
yaffs_read_inode for 2
yaffs locking
yaffs_FillInode mode 41b6 uid 0 gid 0 size 512 count 1
yaffs unlocking
yaffs_loookup dentry
yaffs locking
yaffs_readdir: starting at 5
yaffs unlocking
lost+found toto toto
yaffs_put_inode: ino 1, count 2
#
Best regards,
Cedric