From patchwork Thu Jun 24 20:00:15 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: twebb X-Patchwork-Id: 56834 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 9423AB6F35 for ; Fri, 25 Jun 2010 06:01:54 +1000 (EST) Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.72 #1 (Red Hat Linux)) id 1ORsay-0004fL-3Z; Thu, 24 Jun 2010 20:00:20 +0000 Received: from mail-iw0-f177.google.com ([209.85.214.177]) by bombadil.infradead.org with esmtp (Exim 4.72 #1 (Red Hat Linux)) id 1ORsav-0004ee-6s for linux-mtd@lists.infradead.org; Thu, 24 Jun 2010 20:00:17 +0000 Received: by iwn1 with SMTP id 1so252456iwn.36 for ; Thu, 24 Jun 2010 13:00:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=wvuowfDPwsvJh2t4xFMVK7Y1VifAjYcufmMkzibSMyk=; b=DmRK8cPJcxDaNlqqMHdbDMK1hNc68btHqWvG8fghLcicRL3PdQ03ua8fjM27sPIXFg qOvQfH3xMsgp42wgNxZZBmw+W0Yaeyd3e7ek10te/wUUHoUHUr8K5AGCk3K85cQet8tD Gucr2gcHamKhu6ZKcU8Mx6oCjGmb7k8d55gU8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=iAhwvRrx6CIycJYSIGXMOMJcTU8dgkkrfREsMBm442fUL011pzRU0Bv4lo7sv514RT C2SSAdvByWDEzydklgFVoWg5yGaBml/X3IiVyfq1t9AVWO2EAp9OiSUgMFyZM5ws0fSJ u03kuJgpr6cLhkKgU9ztW1UxUE/eJ26MivDuM= MIME-Version: 1.0 Received: by 10.231.37.140 with SMTP id x12mr11391282ibd.127.1277409615507; Thu, 24 Jun 2010 13:00:15 -0700 (PDT) Received: by 10.231.150.129 with HTTP; Thu, 24 Jun 2010 13:00:15 -0700 (PDT) Date: Thu, 24 Jun 2010 16:00:15 -0400 Message-ID: Subject: error handling in replay_log_leb() From: twebb To: linux-mtd@lists.infradead.org X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20100624_160017_336022_111FC52E X-CRM114-Status: GOOD ( 11.46 ) X-Spam-Score: 2.1 (++) X-Spam-Report: SpamAssassin version 3.3.1 on bombadil.infradead.org summary: Content analysis details: (2.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is freemail (taliaferro62[at]gmail.com) 2.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (taliaferro62[at]gmail.com) -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.0 T_TO_NO_BRKTS_FREEMAIL T_TO_NO_BRKTS_FREEMAIL 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: , Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org In the replay.c/replay_log_leb(), is there any disadvantage to calling ubifs_recover_log_leb() regardless of whether need_recovery is true or not? I'm having an issue with ubifs dealing with a PEB with corrupt empty space and this condition is handled fine during a mount when need_recovery is true, but is not handled the same otherwise and results in a failed mount. A patch with the proposed change is below. This question is along the same lines as one I asked yesterday about ubifs_scan() error handling. Thanks, twebb Index: replay.c ================================================ --- replay.c (revision 2438) +++ replay.c (working copy) @@ -838,7 +838,7 @@ dbg_mnt("replay log LEB %d:%d", lnum, offs); sleb = ubifs_scan(c, lnum, offs, sbuf); if (IS_ERR(sleb) ) { - if (PTR_ERR(sleb) != -EUCLEAN || !c->need_recovery) + if (PTR_ERR(sleb) != -EUCLEAN) return PTR_ERR(sleb); sleb = ubifs_recover_log_leb(c, lnum, offs, sbuf); if (IS_ERR(sleb))