[ECOS] jffs2 creat file error

Jürgen Lambrecht Jurgen.Lambrecht@tiscali.be
Tue Oct 17 07:01:00 GMT 2006


Hello Srinivas,

I  had the same problem with that magic bitmask. For all 32b words in flash it gives that message. Your system probably does not hang, at mount time it just prints that message for each 4B of your flash ...

The problem is that your flash is not "formatted". You just have to mark all empty nodes of your flash as unused with that magic bitmask. I have added a "format jffs2" command to redboot that we run for each new board. Maybe I should commit this to ecos if someone could use this..

And for ARM platforms, there is a bug in gcc that prevents to solve the magic bitmask problem when noticed. With that bug solved, the first time you get all those errors printed, but they are solved by writing the correct magic bitmask.

/* 		struct jffs2_unknown_node marker = { */
/* 			.magic =	cpu_to_je16(JFFS2_MAGIC_BITMASK), */
/* 			.nodetype =	cpu_to_je16(JFFS2_NODETYPE_CLEANMARKER), */
/* 			.totlen =	cpu_to_je32(c->cleanmarker_size) */
/* 		}; */
/* patch from 2003-08-04  <Øyvind Harboe <oyvind.harboe@zylin.com> because of
    broken arm-elf-gcc 3.2.1
    http://ecos.sourceware.org/ml/ecos-patches/2003-08/msg00006.html */
		struct jffs2_unknown_node marker;
		memset(&marker, 0, sizeof(marker));
		marker.magic =	cpu_to_je16(JFFS2_MAGIC_BITMASK);
		marker.nodetype =	cpu_to_je16(JFFS2_NODETYPE_CLEANMARKER);
		marker.totlen =	cpu_to_je32(c->cleanmarker_size);


Kind regards,

Jürgen Lambrecht
Development Engineer
Televic Transport Systems
http://www.televic.com
Televic NV / SA (main office)  	
Leo Bekaertlaan 1
B-8870 Izegem
Tel: +32 (0)51 303045
Fax: +32 (0)51 310670
Srinivas rao wrote:
 > ----- Original Message ----
 > From: Andrew Lunn <andrew@lunn.ch>
 > To: Srinivas rao <ch_srinivas321@yahoo.co.in>
 > Cc: ecos <ecos-discuss@sourceware.org>
 > Sent: Monday, 16 October, 2006 3:24:45 PM
 > Subject: Re: [ECOS] jffs2 creat file error
 >
 > On Mon, Oct 16, 2006 at 03:20:25PM +0530, Srinivas rao wrote:
 >
 >>I allocated from 11th sector to 64th  sector. each sector 128kb
 >>my jffs2 file size is 0x5038b0 bytes
 >>
 >>Thanks & Regards
 >>Srinivas Rao.Ch
 >>
 >>----- Original Message ----
 >>From: Andrew Lunn <andrew@lunn.ch>
 >>To: Srinivas rao <ch_srinivas321@yahoo.co.in>
 >>Cc: ecos <ecos-discuss@sourceware.org>
 >>Sent: Monday, 16 October, 2006 3:04:39 PM
 >>Subject: Re: [ECOS] jffs2 creat file error
 >>
 >>On Mon, Oct 16, 2006 at 02:23:15PM +0530, Srinivas rao wrote:
 >>
 >>> Hi,
 >>>
 >>>I enabled jffs2 package on eCos and testing on my board.
 >>>My jffs2 is on 11th sector of flash. 'ls" working fine.
 >>> After ls, Iam getting error like below
 >>>pls provide the information regarding below error
 >>>
 >>>
 >>>>Eep. Child "ram3" (ino #127) of dir ino #4 doesn't exist!
 >>>
 >>><INFO>: reading directory /
 >>><INFO>: entry              . [mode 016f0001 ino 00000001 nlink 1 size 0]
 >>><INFO>: entry             .. [mode 016f0001 ino 00000001 nlink 1 size 0]
 >>><INFO>: entry            etc [mode 017f0001 ino 00000005 nlink 1 size 0]
 >>><INFO>: entry            dev<FAIL>: stat() returned -1 No such entity
 >>>
 >>><INFO>: entry            bin [mode 017f0001 ino 00000003 nlink 1 size 0]
 >>><INFO>: entry            otg [mode 017f0001 ino 0000000b nlink 1 size 0]
 >>><INFO>: entry            mp3 [mode 016f0001 ino 0000000a nlink 1 size 0]
 >>><INFO>: entry            lib [mode 017f0001 ino 00000007 nlink 1 size 0]
 >>><INFO>: entry            mnt [mode 017f0001 ino 00000008 nlink 1 size 0]
 >>><INFO>: entry            var [mode 01ff0100 ino 00000015 nlink 1 size 10]
 >>><INFO>: entry            usr [mode 017f0001 ino 00000014 nlink 1 size 0]
 >>><INFO>: entry            tmp [mode 01ff0100 ino 00000011 nlink 1 size 10]
 >>><INFO>: entry            sys [mode 017f0001 ino 00000010 nlink 1 size 0]
 >>><INFO>: entry           home [mode 017f0001 ino 00000006 nlink 1 size 0]
 >>><INFO>: entry           sbin [mode 017f0001 ino 0000000e nlink 1 size 0]
 >>><INFO>: entry           proc [mode 017f0001 ino 0000000c nlink 1 size 0]
 >>><INFO>: entry         rdisk0 [mode 017f0001 ino 0000000d nlink 1 size 0]
 >>><INFO>: entry       usb_mods [mode 017f0001 ino 00000012 nlink 1 size 0]
 >>><INFO>: entry    armboot.bin [mode 017f0008 ino 00000002 nlink 1 size 108048]
 >>><INFO>: entry     scripts.sh [mode 004f0008 ino 0000000f nlink 1 size 284]
 >>><INFO>: entry   usbip_server [mode 016f0001 ino 00000013 nlink 1 size 0]
 >>><INFO>: entry        modules [mode 017f0001 ino 00000009 nlink 1 size 0]
 >>><INFO>: create file /foo size 202
 >>><FAIL>: open() returned -1 No space left on device
 >>
 >>                             ^^^^^^^^^^^^^^^^^^^^^^^^
 >>
 >>How much flash space have you allocated to the filesystem?
 >
 >
 > 53 blocks, each block is 128 KBytes = 6946816 Bytes.
 >
 > JFFS2 needs around 5 free blocks in order for garbage collection to
 > work. Maybe your filesystem is full! Delete some files and run the
 > test again.
 >
 >       Andrew
 > my jffs2 file size is 0x33a3d0 bytes. and I giben more than 5 free blocks in order for garbage collection.
 > Now Iam getting error like below
 >
 > <5>jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0033a3d0: 0x727b
 >  instead
 > <5>jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0033a3d4: 0xb1a7
 >  instead
 > <5>jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0033a3d8: 0x0fdf
 >  instead
 > <5>jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0033a3dc: 0x3f91
 >  instead
 >
 > now hanging. Pls provide the solution.
 >
 > Thanks & Regards
 > Srinivas Rao
 >
 >
 >
 >

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss



More information about the Ecos-discuss mailing list