From patchwork Tue Mar 11 06:23:12 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: pekon gupta X-Patchwork-Id: 328930 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:770:15f::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id E886D2C00B9 for ; Tue, 11 Mar 2014 17:24:15 +1100 (EST) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WNG6a-0007gB-HC; Tue, 11 Mar 2014 06:24:00 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WNG6Y-00012i-Tl; Tue, 11 Mar 2014 06:23:58 +0000 Received: from arroyo.ext.ti.com ([192.94.94.40]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WNG6W-000120-QK for linux-mtd@lists.infradead.org; Tue, 11 Mar 2014 06:23:57 +0000 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id s2B6NRHu025126; Tue, 11 Mar 2014 01:23:27 -0500 Received: from DLEE70.ent.ti.com (dlemailx.itg.ti.com [157.170.170.113]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id s2B6NRxU017637; Tue, 11 Mar 2014 01:23:27 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.3.174.1; Tue, 11 Mar 2014 01:23:27 -0500 Received: from psplinux063.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id s2B6NO23028588; Tue, 11 Mar 2014 01:23:25 -0500 From: Pekon Gupta To: Brian Norris , Artem Bityutskiy Subject: [RFC PATCH] UBIFS: remove check for all(0xff) for empty pages Date: Tue, 11 Mar 2014 11:53:12 +0530 Message-ID: <1394518992-26969-1-git-send-email-pekon@ti.com> X-Mailer: git-send-email 1.8.5.1.163.gd7aced9 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140311_022356_963890_1DBB8185 X-CRM114-Status: UNSURE ( 9.11 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -6.9 (------) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-6.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [192.94.94.40 listed in list.dnswl.org] -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Kent Li , HOUR Frderic , linux-mtd , Pekon Gupta , Ezequiel Garcia , Stefan Roese X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org UBIFS throws following error if an blank page does not contain perfect all(0xff) data, during LEB scan, even though if number of bit-flips is within ecc.strength "UBIFS error (pid 1): ubifs_scan: corrupt empty space at LEB 417:53168" But newer technology devices (like MLC NAND) are prone to read-disturb bit-flips and so having perfect all(0xff) data on empty-pages is practically not feasible on these newer technology devices (like MLC NAND). Also, such device spec suggest using stronger ECC schemes (like BCH16), and have large OOB size to guarantee longer field life. So this check of perfect all(0xff) data can be safely removed from UBIFS, as UBI and MTD layers already these before passing the data to UBIFS: if (number-of-bitflips < mtd->bitflip_threshold) Driver's ECC scheme is strong enough to handle existing bit-flips in future, so both MTD and UBI ignore such bit-flips. if (number-of-bitflips >= mtd->bitflip_threshold) MTD flags -EUCLEAN. UBI schedules the block for scrubbing. if (number-of-bitflips > nand_chip->ecc.strength) MTD flags -EBADMSG. UBI tries to extract data relevant data from block based on sanity of its headers, and then schedule it for re-erase. Signed-off-by: Pekon Gupta --- fs/ubifs/scan.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/fs/ubifs/scan.c b/fs/ubifs/scan.c index 58aa05d..b6ab396 100644 --- a/fs/ubifs/scan.c +++ b/fs/ubifs/scan.c @@ -332,17 +332,6 @@ struct ubifs_scan_leb *ubifs_scan(const struct ubifs_info *c, int lnum, ubifs_end_scan(c, sleb, lnum, offs); - for (; len > 4; offs += 4, buf = buf + 4, len -= 4) - if (*(uint32_t *)buf != 0xffffffff) - break; - for (; len; offs++, buf++, len--) - if (*(uint8_t *)buf != 0xff) { - if (!quiet) - ubifs_err("corrupt empty space at LEB %d:%d", - lnum, offs); - goto corrupted; - } - return sleb; corrupted: