From: David Woodhouse Date: Mon, 23 Apr 2007 11:11:46 +0000 (+0100) Subject: [JFFS2] Improve failure mode if inode checking leaves unchecked space. X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=44b998e1eb254edc87177819ee693690fac68b7f;p=linux-beck.git [JFFS2] Improve failure mode if inode checking leaves unchecked space. We should never find the unchecked size is non-zero after we've finished checking all inodes. If it happens, used to BUG(), leaving the alloc_sem held and deadlocking. Instead, just return -ENOSPC after complaining. The GC thread will die, but read-only operation should be able to continue and the file system should be unmountable. Signed-off-by: David Woodhouse --- diff --git a/fs/jffs2/gc.c b/fs/jffs2/gc.c index 3a3cf225981f..e92cf0f02529 100644 --- a/fs/jffs2/gc.c +++ b/fs/jffs2/gc.c @@ -144,7 +144,8 @@ int jffs2_garbage_collect_pass(struct jffs2_sb_info *c) c->unchecked_size); jffs2_dbg_dump_block_lists_nolock(c); spin_unlock(&c->erase_completion_lock); - BUG(); + up(&c->alloc_sem); + return -ENOSPC; } spin_unlock(&c->erase_completion_lock);