public inbox for ecos-maintainers@sourceware.org
 help / color / mirror / Atom feed
* FWD: JFFS2 : Node info mutex fix suggestion.
@ 2004-02-16 17:07 Andrew Lunn
  2004-02-17 14:11 ` Gary Thomas
  0 siblings, 1 reply; 6+ messages in thread
From: Andrew Lunn @ 2004-02-16 17:07 UTC (permalink / raw)
  To: eCos Maintainers, dwmw2

Hi Folks

Does anybody know how locking should work in the jffs2 package? 

To me this patch looks the wrong solution. 

   Thanks
        Andrew

----- Forwarded message from Alf Nilsson <alf.nilsson@abem.se> -----

Date: Thu, 12 Feb 2004 17:19:31 +0100
From: Alf Nilsson <alf.nilsson@abem.se>
To: ecos-patches@sources.redhat.com
Subject: JFFS2 : Node info mutex fix suggestion.
X-Spam-Status: No, hits=-4.9 required=5.0 tests=BAYES_00 autolearn=ham 
	version=2.63

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 */


----- End forwarded message -----

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

end of thread, other threads:[~2004-02-17 15:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-16 17:07 FWD: JFFS2 : Node info mutex fix suggestion Andrew Lunn
2004-02-17 14:11 ` Gary Thomas
2004-02-17 14:58   ` David Woodhouse
2004-02-17 15:09     ` Gary Thomas
2004-02-17 15:42       ` Gary Thomas
2004-02-17 15:59         ` David Woodhouse

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).