From patchwork Thu Oct 7 16:29:46 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joakim Tjernlund X-Patchwork-Id: 67074 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from canuck.infradead.org (canuck.infradead.org [134.117.69.58]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id EECBFB70CC for ; Fri, 8 Oct 2010 03:31:17 +1100 (EST) Received: from localhost ([127.0.0.1] helo=localhost.localdomain) by canuck.infradead.org with esmtp (Exim 4.72 #1 (Red Hat Linux)) id 1P3tLs-00048B-8S; Thu, 07 Oct 2010 16:29:52 +0000 Received: from gw1.transmode.se ([213.115.205.20]) by canuck.infradead.org with esmtps (Exim 4.72 #1 (Red Hat Linux)) id 1P3tLq-00045P-8T for linux-mtd@lists.infradead.org; Thu, 07 Oct 2010 16:29:50 +0000 Received: from sesr04.transmode.se (sesr04.transmode.se [192.168.201.15]) by gw1.transmode.se (Postfix) with ESMTP id 2A3002597D6 for ; Thu, 7 Oct 2010 18:29:48 +0200 (CEST) Received: from gentoo-jocke.transmode.se ([192.168.1.15]) by sesr04.transmode.se (Lotus Domino Release 8.5.2 HF23) with ESMTP id 2010100718294822-3216 ; Thu, 7 Oct 2010 18:29:48 +0200 Received: from gentoo-jocke.transmode.se (gentoo-jocke.transmode.se [127.0.0.1]) by gentoo-jocke.transmode.se (8.14.4/8.14.0) with ESMTP id o97GTmlC024670; Thu, 7 Oct 2010 18:29:48 +0200 Received: (from jocke@localhost) by gentoo-jocke.transmode.se (8.14.4/8.14.4/Submit) id o97GTmQF024669; Thu, 7 Oct 2010 18:29:48 +0200 From: Joakim Tjernlund To: linux-mtd@lists.infradead.org Subject: [PATCH] jffs2: Do not assume erase will fail Date: Thu, 7 Oct 2010 18:29:46 +0200 Message-Id: <1286468986-24627-1-git-send-email-Joakim.Tjernlund@transmode.se> X-Mailer: git-send-email 1.7.2.2 X-MIMETrack: Itemize by SMTP Server on sesr04/Transmode(Release 8.5.2 HF23|September 01, 2010) at 2010-10-07 18:29:48, Serialize by Router on sesr04/Transmode(Release 8.5.2 HF23|September 01, 2010) at 2010-10-07 18:29:48, Serialize complete at 2010-10-07 18:29:48 X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20101007_122950_527033_ADFBCA78 X-CRM114-Status: GOOD ( 10.82 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain Cc: Joakim Tjernlund X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Test if it did and then abort. Signed-off-by: Joakim Tjernlund --- 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;