This is the mail archive of the ecos-patches@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

JFFS2 : Node info mutex fix suggestion.


When running a project with priority inheritance we noticed that all the threads that passed though JFFS did not return to their original priority. This due to the mutex count in the jffs2_inode_info was in some cases 2 as lowest. We found that this depended on a call to fs-ecos.c:jffs2_init_inode_info in fs-ecos.c:jffs2_new_inode. The 2nd call in fs-ecos.c:jffs2_new_inode that increases the mutex occurs in read.c:jffs2_do_new_inode.
This might not be the ultimate solution, but it seemed like the right place to place the patch, but I'm open for suggestions.


Regards,
Alf Nilsson
Index: current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/fs/jffs2/current/ChangeLog,v
retrieving revision 1.24
diff -u -w -p -r1.24 ChangeLog
--- current/ChangeLog	27 Jan 2004 10:49:06 -0000	1.24
+++ current/ChangeLog	12 Feb 2004 16:01:10 -0000
@@ -1,3 +1,10 @@
+2004-02-12  Alf Nilsson  <alf.nilsson@abem.se>
+
+	* src/fs-ecos.c: Removed call to jffs2_init_inode_info in
+	jffs2_new_inode. The call resulted in the mutex in the inode_info
+	being locked twice. The 2nd lock is in the call to 
+	jffs2_do_new_inode.
+
 2004-01-09  Thomas Koeller  <thomas.koeller@baslerweb.com>
 
 	* src/fs-ecos.c: Fixed inode reference counting in jffs2_ops_link().
Index: current/src/fs-ecos.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/fs/jffs2/current/src/fs-ecos.c,v
retrieving revision 1.17
diff -u -w -p -r1.17 fs-ecos.c
--- current/src/fs-ecos.c	27 Jan 2004 10:49:06 -0000	1.17
+++ current/src/fs-ecos.c	12 Feb 2004 16:01:11 -0000
@@ -1849,7 +1849,7 @@ struct _inode *jffs2_new_inode (struct _
 		return ERR_PTR(-ENOMEM);
 
 	f = JFFS2_INODE_INFO(inode);
-	jffs2_init_inode_info(f);
+	memset(f, 0, sizeof(*f));
 
 	memset(ri, 0, sizeof(*ri));
 	/* Set OS-specific defaults for new inodes */

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]