This is the mail archive of the
ecos-patches@sources.redhat.com
mailing list for the eCos project.
RE: eCos jffs2 garbage collection thread + fix
- From: "Per Hedblom" <per dot hedblom at abem dot se>
- To: "'Andrew Lunn'" <andrew at lunn dot ch>
- Cc: "'eCos Patches'" <ecos-patches at ecos dot sourceware dot org>,"'David Woodhouse'" <dwmw2 at infradead dot org>
- Date: Fri, 10 Dec 2004 11:31:43 +0100
- Subject: RE: eCos jffs2 garbage collection thread + fix
- Organization: ABEM Instrument AB
> I would probably move the mutex initialisation into jffs2_mount rather
> than hide it inside the GC code. I missed it the first time i read the
> code. The mutex does not belong to GC, it belongs more to the
> cache. So put it there the linked list is initialised.
Actual my first attempt was to use the cyg_fs_lock to protect the cache
during gc but I didn't succeed. Lately I discovered that I get strange
pointer errors in the iput/ilockup/ievict code when I access the filesystem
from different threads without the gc thread. It seams to work correct if I
turn on my implementation of the cache lock (without gc thread).
After rechecking the cyg_fs_lock and the syncmode used for jffs2 it seams
that my problem(s) could be related to the use of CYG_SYNCMODE_IO_FILE
instead of CYG_SYNCMODE_IO_FILESYSTEM. It takes some time to run a test to
see if it works better so it would be helpful with some comments on this
before trying.
I still believe that it should work to use cyg_fs_lock to protect the
filesystem during gc. Comments?
Index: fs-ecos.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/fs/jffs2/current/src/fs-ecos.c,v
retrieving revision 1.32
diff -u -w -b -r1.32 fs-ecos.c
--- fs-ecos.c 12 Nov 2004 16:50:33 -0000 1.32
+++ fs-ecos.c 10 Dec 2004 10:01:21 -0000
@@ -97,7 +97,7 @@
#ifdef CYGOPT_FS_JFFS2_WRITE
FSTAB_ENTRY(jffs2_fste, "jffs2", 0,
- CYG_SYNCMODE_FILE_FILESYSTEM | CYG_SYNCMODE_IO_FILE,
+ CYG_SYNCMODE_FILE_FILESYSTEM | CYG_SYNCMODE_IO_FILESYSTEM,
jffs2_mount,
jffs2_umount,
jffs2_open,
@@ -110,7 +110,7 @@
jffs2_chdir, jffs2_stat, jffs2_getinfo, jffs2_setinfo);
#else
FSTAB_ENTRY(jffs2_fste, "jffs2", 0,
- CYG_SYNCMODE_FILE_FILESYSTEM | CYG_SYNCMODE_IO_FILE,
+ CYG_SYNCMODE_FILE_FILESYSTEM | CYG_SYNCMODE_IO_FILESYSTEM,
jffs2_mount,
jffs2_umount,
jffs2_open,
>
> You also seem to of missed icache_evict() which needs locking.
>
... the call from jffs2_umount.
/Per
(I am doing some progress with the copyright assignment)