public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] RAMFS problem
@ 2001-07-20  9:59 Richard Panton
  2001-07-25 22:44 ` Jonathan Larmour
  0 siblings, 1 reply; 2+ messages in thread
From: Richard Panton @ 2001-07-20  9:59 UTC (permalink / raw)
  To: ecos discussion list

It seems that ramfs is failing for files bigger than 0x8800 bytes (using
the default configuration).

When the fault occurs:
	All 8 direct blocks are full.
	The indirect block points to:
		All 64 direct pointers used.
	The indirect2 block points to:
		Indirect block points to:
			All 64 direct pointers used.

When an attempt is made to write to node->indirect2->indirect[1]->data, a
data fault occurs.

I think to fix this requires a change to findbuffer_indirect1():
Index: ramfs.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/fs/ram/current/src/ramfs.c,v
retrieving revision 1.1
diff -r1.1 ramfs.c
777c777
<     err = findbuffer_direct( bi,
---
>     err = findbuffer_direct( bi * CYGNUM_RAMFS_BLOCK_SIZE,

===================================================================

Without the multiplier, bi (used here as an offset rather than a block
number) can range from 0 to CYGNUM_RAMFS_BLOCK_SIZE - 1

This ALWAYS falls inside the first (indirect) block, so the reference
later on in the function to blocks[bi] refers to an unassigned block.

(Also, at line 726, shouldn't that be:

if ( bi >= nblocks )

rather than

if ( bi > nblocks )

?????)

There's probably a similar sort of fix required in findbuffer_indirect2(),
but my head hurts enough already after trying to trace this through....

Nick, your name's on this one...

Best Regards,
Richard

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

end of thread, other threads:[~2001-07-25 22:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-07-20  9:59 [ECOS] RAMFS problem Richard Panton
2001-07-25 22:44 ` Jonathan Larmour

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).