diff -rbup jffs2.orig/current/ChangeLog jffs2/current/ChangeLog --- jffs2.orig/current/ChangeLog Thu Apr 29 09:16:10 2004 +++ jffs2/current/ChangeLog Fri Jul 30 09:20:43 2004 @@ -1,3 +1,7 @@ +2004-07-30 Alexander Neundorf + *src/gc.c: sync with mtd cvs: release the alloc_sem + correctly in case of error, otherwise possible deadlock + 2004-04-19 Oyvind Harboe * src/build.c: JFFS2 can now be used as a write-once, read many mode diff -rbup jffs2.orig/current/src/gc.c jffs2/current/src/gc.c --- jffs2.orig/current/src/gc.c Thu Apr 1 05:17:57 2004 +++ jffs2/current/src/gc.c Fri Jul 30 09:19:30 2004 @@ -358,10 +358,14 @@ int jffs2_garbage_collect_pass(struct jf 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 (IS_ERR(f)) { + ret = PTR_ERR(f); + goto release_sem; + } + if (!f) { + ret = 0; + goto release_sem; + } ret = jffs2_garbage_collect_live(c, jeb, raw, f);