Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030260AbVIVLei (ORCPT ); Thu, 22 Sep 2005 07:34:38 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1030272AbVIVLei (ORCPT ); Thu, 22 Sep 2005 07:34:38 -0400 Received: from mail.fh-wedel.de ([213.39.232.198]:46771 "EHLO moskovskaya.fh-wedel.de") by vger.kernel.org with ESMTP id S1030260AbVIVLeh (ORCPT ); Thu, 22 Sep 2005 07:34:37 -0400 Date: Thu, 22 Sep 2005 13:34:30 +0200 From: =?iso-8859-1?Q?J=F6rn?= Engel To: Pavel Machek Cc: "Artem B. Bityutskiy" , Peter Menzebach , linux-kernel Subject: Re: data loss on jffs2 filesystem on dataflash Message-ID: <20050922113430.GA2732@wohnheim.fh-wedel.de> References: <4329251C.7050102@mw-itcon.de> <4329288B.8050909@yandex.ru> <43292AC6.40809@mw-itcon.de> <43292E16.70401@yandex.ru> <43292F91.9010302@mw-itcon.de> <432FE1EF.9000807@yandex.ru> <432FEF55.5090700@mw-itcon.de> <433006D8.4010502@yandex.ru> <20050920133244.GC4634@wohnheim.fh-wedel.de> <20050921190759.GC467@openzaurus.ucw.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20050921190759.GC467@openzaurus.ucw.cz> User-Agent: Mutt/1.3.28i Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2419 Lines: 57 On Wed, 21 September 2005 21:07:59 +0200, Pavel Machek wrote: > > > > I glanced at the manual. Uhh, DataFlash is very specific beast. It > > > suppoers page program with built-in erase command... So DataFlash > > > effectively may be considered as a block device. Then you may use any FS > > > on it providing you have wrote proper driver? Why do you need JFFS2 then > > > :-) ? > > > > Still can't. Block devices have the attribute that writing AAA... to > > a block containing BBB... gives you one of three possible results in > > case of power failure: > > > > 1. BBB...BBB all written > > 2. AAA...AAA nothing written > > 3. AAA...BBB partially written. > > > > Flash doesn't have 3, but two more cases: > > 4. FFF...FFF erased, nothing written > > 5. AAA...FFF erased, partially written > > > > Plus the really obnoxious > > 6. FFF...FFF partially erased. Looks fine but some bits may flip > > randomly, writes may not stick, etc. > > > > Now try finding a filesystem that is robust if 4-6 happens. ;) > > ext2 and anything that does not do journalling? > > I do not thing behaviour on powerfail is part of block device definition. Noone bothered defining it, but most everyone is happy about it being as it is. Non-journalling filesystems would have severe corruption on unclean umounts. lost+found would fill up much faster than people are used to, if 4-6 was common for hard disks. Journalling filesystems actually would be robust against 4-6, as long as their block size was large enough. The journal must contain the complete erase block from flash - which is commonly in the area of 64k or 128k. Ext3 blocks are much smaller, so the fs would still corrupt. Well - DataFlash appears to have very small block sizes. So yes, it would be possible to use ext3 on it. But then there's still the problem of limited per-block flash lifetime and ext3 doesn't do wear levelling. J?rn -- You cannot suppose that Moliere ever troubled himself to be original in the matter of ideas. You cannot suppose that the stories he tells in his plays have never been told before. They were culled, as you very well know. -- Andre-Louis Moreau in Scarabouche - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/