This is the mail archive of the
ecos-maintainers@sources.redhat.com
mailing list for the eCos project.
Re: FWD: JFFS2 : Node info mutex fix suggestion.
- From: Gary Thomas <gary at mlbassoc dot com>
- To: Andrew Lunn <andrew at lunn dot ch>
- Cc: eCos Maintainers <ecos-maintainers at ecos dot sourceware dot org>,dwmw2 at cambridge dot redhat dot com
- Date: Tue, 17 Feb 2004 07:11:44 -0700
- Subject: Re: FWD: JFFS2 : Node info mutex fix suggestion.
- Organization: MLB Associates
- References: <20040216170742.GF29388@lunn.ch>
On Mon, 2004-02-16 at 10:07, Andrew Lunn wrote:
> Hi Folks
>
> Does anybody know how locking should work in the jffs2 package?
>
> To me this patch looks the wrong solution.
I agree. I did already pass this to David, with no reply :-(
>
> 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 -----
--
Gary Thomas <gary@mlbassoc.com>
MLB Associates