From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail2.shareable.org ([80.68.89.115]) by bombadil.infradead.org with esmtps (Exim 4.69 #1 (Red Hat Linux)) id 1O4LUH-0005VS-Aw for linux-mtd@lists.infradead.org; Tue, 20 Apr 2010 22:00:10 +0000 Date: Tue, 20 Apr 2010 23:00:07 +0100 From: Jamie Lokier To: Jon Ringle Subject: Re: Erase race? Message-ID: <20100420220007.GP11723@shareable.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Cc: linux-mtd@lists.infradead.org List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Jon Ringle wrote: > On Tue, Apr 13, 2010 at 4:15 PM, Jon Ringle wrote: > > Hi, > > I have a few machines that have UBI and UBIFS on NOR flash that are > > undergoing continuous reboot testing. > > One of them just caught the following failure: > > > > [   51.250000] IXP4XX-Flash.0: buffer write error (status 0xd0) > > [   51.250000] UBI error: ubi_io_write: error -22 while writing 64 > > bytes to PEB 226:0, written 0 bytes > > [   51.270000] UBI error: erase_worker: failed to erase PEB 226, error -22 > > [   51.270000] UBI warning: ubi_ro_mode: switch to read-only mode > > [   51.290000] UBI error: do_work: work failed with error code -22 > > [   51.290000] UBI error: ubi_thread: ubi_bgt0d: work failed with error code -22 > > > > Looking at this it appears that the failure might have been caused due > > to the erase_worker and ubi_io_write occurring out of order... since > > it looks like ubi_io_write was trying to write at offset 0 of the PEB, > > which I imagine would have to be the EC header, which should happen > > after the block is erased. But it doesn't seem to be the case here. > > I had this issue occur again on another system: > [ 48.250000] IXP4XX-Flash.0: buffer write error (status 0xd0) > [ 48.250000] UBI error: ubi_io_write: error -22 while writing 64 > bytes to PEB 111:0, written 0 bytes > [ 48.280000] UBI error: erase_worker: failed to erase PEB 111, error -22 > [ 48.280000] UBI warning: ubi_ro_mode: switch to read-only mode > [ 48.310000] UBI error: do_work: work failed with error code -22 > [ 48.310000] UBI error: ubi_thread: ubi_bgt0d: work failed with error code -22 > > Can anyone comment as to my theory that this is a race condition > between ubi_io_write and erase_worker occurring out of order? I have nothing to offer, but I'm interested in anything more you discover as I would like to use UBIFS on NOR too. -- Jamie