From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mr213138.mail.yeah.net ([223.252.213.138]) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1badvP-0007uz-Am for linux-mtd@lists.infradead.org; Fri, 19 Aug 2016 07:09:13 +0000 Subject: Re: MTD RAID To: Boris Brezillon , Dongsheng Yang References: <20160819084908.4955c629@bbrezillon> Cc: fabf@skynet.be, jesper.nilsson@axis.com, Dongsheng Yang , linux-cris-kernel@axis.com, shengyong1@huawei.com, Ard Biesheuvel , richard , dmitry.torokhov@gmail.com, dooooongsheng.yang@gmail.com, jschultz@xes-inc.com, starvik@axis.com, mtownsend1973@gmail.com, linux-mtd@lists.infradead.org, Colin King , asierra@xes-inc.com, Brian Norris , David Woodhouse From: Dongsheng Yang Message-ID: <57B6B073.9060404@easystack.cn> Date: Fri, 19 Aug 2016 15:08:35 +0800 MIME-Version: 1.0 In-Reply-To: <20160819084908.4955c629@bbrezillon> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On 08/19/2016 02:49 PM, Boris Brezillon wrote: > Hi Dongsheng, > > On Fri, 19 Aug 2016 14:34:54 +0800 > Dongsheng Yang wrote: > >> Hi guys, >> This is a email about MTD RAID. >> >> *Code:* >> kernel: >> https://github.com/yangdongsheng/linux/tree/mtd_raid_v2-for-4.7 > Just had a quick look at the code, and I see at least one major problem > in your RAID-1 implementation: you're ignoring the fact that NAND blocks > can be or become bad. What's the plan for that? Hi Boris, Thanx for your quick reply. When you are using RAID-1, it would erase the all mirrored blockes when you are erasing. if there is a bad block in them, mtd_raid_erase will return an error and the userspace tool or ubi will mark this block as bad, that means, the mtd_raid_block_markbad() will mark the all mirrored blocks as bad, although some of it are good. In addition, when you have data in flash with RAID-1, if one block become bad. For example, when the mtd0 and mtd1 are used to build a RAID-1 device mtd2. When you are using mtd2 and you found there is a block become bad. Don't worry about data losing, the data is still saved in the good one mirror. you can replace the bad one device with another new mtd device. My plan about this feature is all on the userspace tool. (1). mtd_raid scan mtd2 <---- this will show the status of RAID device and each member of it. (2). mtd_raid replace mtd2 --old mtd1 --new mtd3. <---- this will replace the bad one mtd1 with mtd3. What about this idea? Yang > > Regards, > > Boris > > ______________________________________________________ > Linux MTD discussion mailing list > http://lists.infradead.org/mailman/listinfo/linux-mtd/ >