[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <06a5aebc-b90d-4c0b-b496-921e14452f9d@salutedevices.com>
Date: Wed, 25 Oct 2023 17:53:35 +0300
From: Martin Kurbanov <mmkurbanov@...utedevices.com>
To: David Woodhouse <dwmw2@...radead.org>,
Richard Weinberger <richard@....at>
CC: Christian Brauner <brauner@...nel.org>,
Dave Chinner <dchinner@...hat.com>,
Yu Zhe <yuzhe@...china.com>,
linux-kernel <linux-kernel@...r.kernel.org>,
linux-mtd <linux-mtd@...ts.infradead.org>,
<kernel@...rdevices.ru>
Subject: Re: [PATCH v1 2/2] jffs2: make cleanmarker support option
Hi David, Thank you for reply.
On 23.10.2023 20:55, David Woodhouse wrote:
> On Mon, 2023-10-23 at 17:54 +0300, Martin Kurbanov wrote:
>> Hello Richard,
>>
>> On 19.10.2023 11:12, Richard Weinberger wrote:
>>>> This patch support for disable cleanmarker option. This is useful on
>>>> some NAND devices which entire OOB area is protected by ECC. Problem
>>>> fires when JFFS2 driver writes cleanmarker to some page and later it
>>>> tries to write to this page - write will be done successfully, but after
>>>> that such page becomes unreadable due to invalid ECC codes. This occurs
>>>> because the second write necessitates an update to ECC, but it is
>>>> impossible to do it correctly without block erase.
>>> Hmm, I miss an explanation why this change is correct and safe.
>>> You explain why the OOB area can't be used, okay. But you need to
>>> add more details on why you change is safe in terms of filesystem
>>> consistency.
>>
>> If you disable the cleanmarker, the found clean block (filled with 0xff)
>> will be erased again (see fs/jffs2/scan.c#L162).
>> In my opinion, it is better to perform the block erasure again than to
>> not work with such a nand flash at all.
>
> Erasing all unused blocks over and over again on every reboot/remount
> is going to destroy your flash quite quickly, surely?
>
> I think you need to come up with a way to log the clean blocks (or
> erase requests) in the JFFS2 log itself.
>
> Perhaps a 'block erase log' node type, which just contains a version#
> and a list of blocks which are currently being erased. You write it out
> before doing any erase operation. And then at *some* point after the
> erase completes (it doesn't need to be immediate) you write out a new
> one (which may be empty, or may list new blocks which are about to be
> erased).
>
> On mount, we just need to re-erase any blocks which are indicated as
> being erased in the latest erase log node.
What if we don't erase the free blocks during mounting, but instead
erase them when a clean block is needed (before writing)?
--
Best Regards,
Martin Kurbanov
Powered by blists - more mailing lists