diff options
author | David Woodhouse <David.Woodhouse@intel.com> | 2010-05-19 11:37:13 -0400 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2010-05-19 11:49:37 -0400 |
commit | 0717bf8411bb673dd2369aaa096f7396446b38f5 (patch) | |
tree | 5106504557aae93a018bf3a5692ce9b0558e857e /fs/jffs2/erase.c | |
parent | 9957abea31aed5783d6ca7175cce553045c0eb19 (diff) |
jffs2: Erase pending blocks in GC pass, avoid invalid -EIO return
jffs2_garbage_collect_pass() would previously return -EAGAIN if it
couldn't find anything to garbage collect from, and there were blocks on
the erase_pending_list. If the blocks were actually in the process of
being erased, though, then they wouldn't be on that list. Check for
nr_erasing_blocks being non-zero instead.
Fix jffs2_reserve_space() to wait for the in-progress erases to
complete, when jffs2_garbage_collect_pass() returns -EAGAIN.
And fix jffs2_erase_succeeded() to actually wake up the erase_wait wq
that jffs2_reserve_space() is now using.
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'fs/jffs2/erase.c')
-rw-r--r-- | fs/jffs2/erase.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/jffs2/erase.c b/fs/jffs2/erase.c index b2d2b6a6e03e..563c857ca544 100644 --- a/fs/jffs2/erase.c +++ b/fs/jffs2/erase.c | |||
@@ -172,6 +172,7 @@ static void jffs2_erase_succeeded(struct jffs2_sb_info *c, struct jffs2_eraseblo | |||
172 | mutex_unlock(&c->erase_free_sem); | 172 | mutex_unlock(&c->erase_free_sem); |
173 | /* Ensure that kupdated calls us again to mark them clean */ | 173 | /* Ensure that kupdated calls us again to mark them clean */ |
174 | jffs2_erase_pending_trigger(c); | 174 | jffs2_erase_pending_trigger(c); |
175 | wake_up(&c->erase_wait); | ||
175 | } | 176 | } |
176 | 177 | ||
177 | static void jffs2_erase_failed(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb, uint32_t bad_offset) | 178 | static void jffs2_erase_failed(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb, uint32_t bad_offset) |