From patchwork Mon Oct 18 10:02:05 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Artem Bityutskiy X-Patchwork-Id: 68158 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 08699B70E9 for ; Mon, 18 Oct 2010 21:02:43 +1100 (EST) Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.72 #1 (Red Hat Linux)) id 1P7mXB-0007eJ-2D; Mon, 18 Oct 2010 10:01:37 +0000 Received: from mgw-sa02.ext.nokia.com ([147.243.1.48] helo=mgw-sa02.nokia.com) by canuck.infradead.org with esmtps (Exim 4.72 #1 (Red Hat Linux)) id 1P7mX5-0007dd-M9 for linux-mtd@lists.infradead.org; Mon, 18 Oct 2010 10:01:34 +0000 Received: from nokia.com (localhost [127.0.0.1]) by mgw-sa02.nokia.com (Switch-3.4.3/Switch-3.4.3) with ESMTP id o9IA1Rls020238; Mon, 18 Oct 2010 13:01:27 +0300 Received: from eru.research.nokia.com ([esdhcp0353.research.nokia.com [172.21.35.3]]) by mgw-sa02.nokia.com with ESMTP id o9IA1Iow020084 ; Mon, 18 Oct 2010 13:01:19 +0300 From: Artem Bityutskiy To: Matthieu CASTET Subject: [PATCH 2/2] UBIFS: add unstable pages problem description Date: Mon, 18 Oct 2010 13:02:05 +0300 Message-Id: <1287396125-1890-1-git-send-email-dedekind1@gmail.com> X-Mailer: git-send-email 1.7.2.3 X-Nokia-AV: Clean X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20101018_060133_288142_B6637792 X-CRM114-Status: GOOD ( 12.18 ) X-Spam-Score: 3.4 (+++) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (3.4 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 TVD_RCVD_SPACE_BRACKET TVD_RCVD_SPACE_BRACKET 0.0 FREEMAIL_FROM Sender email is freemail (dedekind1[at]gmail.com) 0.0 DKIM_ADSP_CUSTOM_MED No valid author signature, adsp_override is CUSTOM_MED 2.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (dedekind1[at]gmail.com) 1.2 NML_ADSP_CUSTOM_MED ADSP custom_med hit, and not from a mailing list Cc: linux-mtd@lists.infradead.org, Adrian Hunter 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 From: Artem Bityutskiy Describe a problem reported by Matthieu CASTET which is currently not handled by UBIFS. Signed-off-by: Artem Bityutskiy --- fs/ubifs/replay.c | 22 ++++++++++++++++++++++ 1 files changed, 22 insertions(+), 0 deletions(-) diff --git a/fs/ubifs/replay.c b/fs/ubifs/replay.c index eed0fcf..e04d74a 100644 --- a/fs/ubifs/replay.c +++ b/fs/ubifs/replay.c @@ -32,6 +32,28 @@ * larger is the journal, the more memory its index may consume. */ +/* + * Problem description: unstable pages after unclean power cut on NAND flashes. + * + * If a power cut happens when we have ongoing NAND page program, this page + * becomes unstable. The following situations are possible when we mount this + * flash next time and UBIFS reads the page. + * o The page may look like it is empty, i.e., it contains only 0xFFs, but + * we write data there, the data becomes corrupted. I.e., when the data are + * read, we may get a ECC errors. Moreover, the page may be read with no + * errors sometimes, with an ECC error next time, with a bit-flip next + * time, etc. + * o The page may have bit-flip, but when it is read next time, it may have + * ECC errors or no errors at all. + * o An UBIFS node may have correct CRC, but when it is read next time, it + * may have CRC error. + * + * IOW, these unstable pages are disaster. UBIFS has to handle them correctly: + * never write to them and never rely on their contents. + * + * TODO: handle this for buds, log, orphan area, and master area. + */ + #include "ubifs.h" /*