[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

More JFFS problems...




Test program:

	fd = open("testfile", O_CREAT| O_RDWR, S_IRUSR);
	write(fd, "Thrunge\n", 8);
	write(fd, "Wibble\n",7);
	lseek(fd, 2, SEEK_SET);
	write(fd, "xx", 2);
	fsync(fd);
	close(fd);


Result:
[root@alpha1 /mnt]# /home/dwmw2/testfile-alpha 
[root@alpha1 /mnt]# cat testfile 
Thrunge
Wibble
[root@xxxxxxx.
[root@alpha1 /]# umount /mnt
[root@alpha1 /]# mount /dev/mtdblock0 /mnt -t jffs
[root@alpha1 /]# cat mnt/testfile 
Thrunge
Wibble
xx[root@alpha1 /]#              (note the 'xx' is at the end)

 The structure on the media seems to be correct - the third node has a 
start location of '2'. However, the result of reading back the file, either 
immediately, or after a remount, is incorrect.


[root@alpha1 /]# od -t x1 /dev/mtd0 
0000000 31 39 38 34 02 00 00 00 01 00 00 00 01 00 00 00
0000020 a0 81 00 00 00 00 00 00 64 57 83 39 64 57 83 39
0000040 64 57 83 39 00 00 00 00 00 00 00 00 00 00 00 00
0000060 08 01 00 ff 00 00 00 00 60 03 cc 06 74 65 73 74
0000100 66 69 6c 65 31 39 38 34 02 00 00 00 01 00 00 00
0000120 02 00 00 00 a0 81 00 00 00 00 00 00 64 57 83 39
0000140 64 57 83 39 64 57 83 39 00 00 00 00 08 00 00 00
0000160 00 00 00 00 00 01 00 ff e7 02 00 00 00 00 53 07
0000200 54 68 72 75 6e 67 65 0a 31 39 38 34 02 00 00 00
0000220 01 00 00 00 03 00 00 00 a0 81 00 00 00 00 00 00
0000240 64 57 83 39 64 57 83 39 64 57 83 39 08 00 00 00
0000260 07 00 00 00 00 00 00 00 00 01 00 ff 5f 02 00 00
0000300 00 00 d3 06 57 69 62 62 6c 65 0a ff 31 39 38 34
0000320 02 00 00 00 01 00 00 00 04 00 00 00 a0 81 00 00
0000340 00 00 00 00 64 57 83 39 64 57 83 39 64 57 83 39
0000360 0f 00 00 00 02 00 00 00 00 00 00 00 00 01 00 ff
0000400 f0 00 00 00 00 00 65 07 78 78 ff ff ff ff ff ff
0000420 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
*


--
dwmw2