* problems with JFFS2 assert failure on mutex
@ 2004-07-19 15:17 Øyvind Harboe
2004-07-20 13:41 ` David Woodhouse
0 siblings, 1 reply; 3+ messages in thread
From: Øyvind Harboe @ 2004-07-19 15:17 UTC (permalink / raw)
To: linux-mtd
[-- Attachment #1: Type: text/plain, Size: 238 bytes --]
I was working on a different problem when I came across a mutex that
was being obtained twice(discovered via eCos asserts).
On the surface of it, this patch looks correct.
Comments?
--
Øyvind Harboe
http://www.zylin.com
[-- Attachment #2: mutex.txt --]
[-- Type: text/x-patch, Size: 546 bytes --]
Index: gc.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/fs/jffs2/current/src/gc.c,v
retrieving revision 1.7
diff -w -u -r1.7 gc.c
--- gc.c 1 Apr 2004 03:17:57 -0000 1.7
+++ gc.c 19 Jul 2004 12:54:18 -0000
@@ -358,10 +358,10 @@
spin_unlock(&c->inocache_lock);
f = jffs2_gc_fetch_inode(c, inum, nlink);
- if (IS_ERR(f))
- return PTR_ERR(f);
- if (!f)
- return 0;
+ if (!f||IS_ERR(f)) {
+ up(&c->alloc_sem);
+ return f;
+ }
ret = jffs2_garbage_collect_live(c, jeb, raw, f);
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: problems with JFFS2 assert failure on mutex
2004-07-19 15:17 problems with JFFS2 assert failure on mutex Øyvind Harboe
@ 2004-07-20 13:41 ` David Woodhouse
2004-07-20 15:27 ` Øyvind Harboe
0 siblings, 1 reply; 3+ messages in thread
From: David Woodhouse @ 2004-07-20 13:41 UTC (permalink / raw)
To: Øyvind Harboe; +Cc: linux-mtd
On Mon, 2004-07-19 at 17:17 +0200, Øyvind Harboe wrote:
> I was working on a different problem when I came across a mutex that
> was being obtained twice(discovered via eCos asserts).
>
> On the surface of it, this patch looks correct.
Looks correct; I've committed an equivalent to CVS. Thanks.
> Comments?
Only that this error path should never happen. The call to
jffs2_gc_fetch_inode() for a valid inode should _never_ fail.
--
dwmw2
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: problems with JFFS2 assert failure on mutex
2004-07-20 13:41 ` David Woodhouse
@ 2004-07-20 15:27 ` Øyvind Harboe
0 siblings, 0 replies; 3+ messages in thread
From: Øyvind Harboe @ 2004-07-20 15:27 UTC (permalink / raw)
To: David Woodhouse; +Cc: linux-mtd
tir, 20.07.2004 kl. 15.41 skrev David Woodhouse:
> On Mon, 2004-07-19 at 17:17 +0200, Øyvind Harboe wrote:
> > I was working on a different problem when I came across a mutex that
> > was being obtained twice(discovered via eCos asserts).
> >
> > On the surface of it, this patch looks correct.
>
> Looks correct; I've committed an equivalent to CVS. Thanks.
>
> > Comments?
>
> Only that this error path should never happen. The call to
> jffs2_gc_fetch_inode() for a valid inode should _never_ fail.
I believe this was with a corrupt JFFS2 disk.
--
Øyvind Harboe
http://www.zylin.com
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2004-07-20 15:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-19 15:17 problems with JFFS2 assert failure on mutex Øyvind Harboe
2004-07-20 13:41 ` David Woodhouse
2004-07-20 15:27 ` Øyvind Harboe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox