linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] jffs2: Do not assume erase will fail
@ 2010-10-07 16:29 Joakim Tjernlund
  2010-10-12  8:48 ` Artem Bityutskiy
  2010-10-25  0:11 ` David Woodhouse
  0 siblings, 2 replies; 11+ messages in thread
From: Joakim Tjernlund @ 2010-10-07 16:29 UTC (permalink / raw)
  To: linux-mtd; +Cc: Joakim Tjernlund

Test if it did and then abort.

Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
---
 fs/jffs2/nodemgmt.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/jffs2/nodemgmt.c b/fs/jffs2/nodemgmt.c
index 694aa5b..49ee5de 100644
--- a/fs/jffs2/nodemgmt.c
+++ b/fs/jffs2/nodemgmt.c
@@ -260,9 +260,9 @@ static int jffs2_find_nextblock(struct jffs2_sb_info *c)
 		spin_lock(&c->erase_completion_lock);
 
 		/* An erase may have failed, decreasing the
-		   amount of free space available. So we must
-		   restart from the beginning */
-		return -EAGAIN;
+		   amount of free space available. */
+		if (list_empty(&c->free_list))
+			return -EAGAIN; /* restart from the beginning */
 	}
 
 	next = c->free_list.next;
-- 
1.7.2.2

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2010-10-25 11:03 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-07 16:29 [PATCH] jffs2: Do not assume erase will fail Joakim Tjernlund
2010-10-12  8:48 ` Artem Bityutskiy
2010-10-25  0:11 ` David Woodhouse
2010-10-25  6:49   ` Joakim Tjernlund
2010-10-25  9:50     ` David Woodhouse
2010-10-25 10:01       ` Joakim Tjernlund
2010-10-25  8:01   ` Artem Bityutskiy
2010-10-25 10:56     ` David Woodhouse
2010-10-25 11:00       ` Joakim Tjernlund
2010-10-25 11:01         ` David Woodhouse
2010-10-25 11:03           ` Joakim Tjernlund

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).