The sem is acquired when holding spinlock. Once the order is swapped, the problem goes away. The problem has been fixed in late kernels.
#2: (&(&c->erase_completion_lock)->rlock), jffs2_garbage_collect_pass+0x1fc/0x790
#3: (&c->alloc_sem), jffs2_garbage_collect_pass+0x208/0x790
The code is in fs/jffs2/gc.c. Swap line 228 and 229 to solve the problem.
227 D1(printk(KERN_DEBUG "No progress from erasing blocks; doing GC anyway\n"));
228 spin_lock(&c->erase_completion_lock);
229 mutex_lock(&c->alloc_sem);
230 }