Skip to content

Commit

Permalink
[JFFS2] Improve failure mode if inode checking leaves unchecked space.
Browse files Browse the repository at this point in the history
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 <dwmw2@infradead.org>
  • Loading branch information
David Woodhouse committed Apr 23, 2007
1 parent 566865a commit 44b998e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/jffs2/gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 44b998e

Please sign in to comment.