public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] jffs2 view u-boot/linux
@ 2005-05-17  8:39 Jonas Dietsche
  2005-05-30 11:43 ` Jonas Dietsche
  0 siblings, 1 reply; 11+ messages in thread
From: Jonas Dietsche @ 2005-05-17  8:39 UTC (permalink / raw)
  To: u-boot

Hi all,

I'm wondering why linux and u-boot are seeing different files when I use 
a jjfs2 image on my nand flash.

This is what I've done.
I partitioned my nand flash with 3 partitions (u-boot, jffs2, user)
Then I flashed the jffs2 image with nand write.jffs2
booted the uImage from my jffs2 with fsload
That all worked fine (although fsload is extreamly slow) and I can use 
my linux.
Then I created a new file in my root. A "ls" from linux displays that 
file. With a "ls" from u-boot the file is not visible...
So what went wrong?
Who is cheating on me?

Thanks for your help.
Jonas

^ permalink raw reply	[flat|nested] 11+ messages in thread
* [U-Boot-Users] jffs2 view u-boot/linux
@ 2005-06-01 21:50 Dave Ellis
  2005-06-03 13:01 ` Jonas Dietsche
  0 siblings, 1 reply; 11+ messages in thread
From: Dave Ellis @ 2005-06-01 21:50 UTC (permalink / raw)
  To: u-boot

Jonas Dietsche wrote:

> ******The directory Entries******
> 
> testfile

>          build_list: version =  00000001
>          build_list: ino =  00000002
 
> testfile

>          build_list: version =  00000002
>          build_list: ino =  00000000

> How can I manage it that the deleted testfile isn't displayed anymore?

Have you tried using CFG_JFFS2_SORT_FRAGMENTS? I use it and I tried a
similar test and testfile is deleted for u-boot (for U-Boot 1.1.0).
Both jffs2_1pass.c and README.JFFS2 say it is needed if the boot 
partition is writable.

In this case it may just be masking a bug in jffs2_1pass_find_inode().
The search  for the most recent directory entry ignores a directory 
entry with an inode of 0 (unlinked file) even if the version is newer, 
so deletion directory entries are ignored. This doesn't look right 
to me: 

	for(b = pL->dir.listHead; b; b = b->next, counter++) {
		jDir = (struct jffs2_raw_dirent *) (b->offset);
		if ((pino == jDir->pino) && (len == jDir->nsize) &&
		    (jDir->ino) &&	/* 0 for unlink */
		    ^^^^^^^^^^^
		    (!strncmp(jDir->name, name, len))) {	/* a
match */
			if (jDir->version < version)
				continue;

With your test this would find version 1 of the directory entry and
ignore version 2, which unlinks the file.

With CFG_JFFS2_SORT_FRAGMENTS all directory entries except the most 
recent version have their inode set to 0 during the sort, so the
obsolete directory entry would be ignored too.  

> Is this a NAND specific problem?

Probably not.

Dave Ellis

~~~~~~~~~~~~~~~~~~~~~~~~~~
SIXNET - "Leading the Industrial Ethernet Revolution"
331 Ushers Road,   P.O. Box 767, Clifton Park, NY 12065 USA
Tel +1 (518) 877-5173   Fax +1 (518) 877-8346
Email me at: dge at sixnetio.com 
Detailed product info: www.sixnetio.com 
~~~~~~~~~~~~~~~~~~~~~~~~~~

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2005-06-03 18:54 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-17  8:39 [U-Boot-Users] jffs2 view u-boot/linux Jonas Dietsche
2005-05-30 11:43 ` Jonas Dietsche
2005-05-30 12:17   ` Wolfgang Denk
2005-05-30 13:08     ` Jonas Dietsche
2005-05-30 13:32       ` Wolfgang Denk
2005-05-30 14:36         ` Jonas Dietsche
2005-06-01 15:13   ` Jonas Dietsche
2005-06-01 21:01     ` Wolfgang Denk
  -- strict thread matches above, loose matches on Subject: below --
2005-06-01 21:50 Dave Ellis
2005-06-03 13:01 ` Jonas Dietsche
2005-06-03 18:54   ` Dave Ellis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox