From: "Artem B. Bityutskiy" <dedekind@yandex.ru>
To: Anders Grafstrom <grfstrm@users.sourceforge.net>
Cc: linux-mtd@lists.infradead.org
Subject: Re: mtd/fs/jffs2 erase.c,1.84,1.85 roll back
Date: Tue, 20 Sep 2005 20:48:25 +0400 [thread overview]
Message-ID: <43303D59.1040805@yandex.ru> (raw)
In-Reply-To: <43303409.5030406@users.sourceforge.net>
Hello,
Anders Grafstrom wrote:
> Artem Bityutskiy wrote:
>> Index: erase.c
>> ===================================================================
>> RCS file: /home/cvs/mtd/fs/jffs2/erase.c,v
>> retrieving revision 1.84
>> retrieving revision 1.85
>> diff -u -r1.84 -r1.85
>> --- erase.c 20 Sep 2005 14:27:34 -0000 1.84
>> +++ erase.c 20 Sep 2005 14:53:15 -0000 1.85
>> @@ -337,7 +337,6 @@
>> if (*datum + 1) {
>> *bad_offset += i;
>> printk(KERN_WARNING "Newly-erased block contained
>> word 0x%lx at offset 0x%08x\n", *datum, *bad_offset);
>> - ret = -EIO;
>> goto fail;
>> }
>> }
>
>
> May I ask why you rolled back this change?
No problems :-)
> I have a problem, that I'm trying to solve, with blocks that are not
> erased despite a "successful" return from c->mtd->erase(). The result of
> this is a very broken filesystem when the blocks are reused. It seems to
> me that the above rolled back change would prevent the filesystem from
> being broken in this situation(?).
Let's analyse the situation.
JFFS2 issues the erase command, MTD returns OK, but the eraseblock does
not contain all 0xFFs. Is this JFFS2's fault? No. this is driver's
fault. The driver must not return success in this case. It must return
an error.
And the check in JFFS2 that the eraseblock contains all FFs is *wrong*.
That's not JFFS2's business at all. That's MTD's business. MTD
guarantees that it either erases the eraseblock or returns error. My
oppinion is that this check must go to MTD. Perhaps, you may embrace it
by #ifdefs - this is the implementation detal.
So, JFFS2 does what it is not supposed to do at all. It slows down
things by this. I wanted to remove the check, but dwmw2 loudly
complained. He wants to be as reliable as it is possible.
Ok, now about the rollback. If we return -EIO, JFFS2 will mark the block
as bad. Imagine your driver is broken, and the block is not actually
bad. That's just driver. JFFS2 will mark nearly all eraseblocks as bad.
What will you do next? In case of NAND, this assumes you're in trouble
unless you have a list of real bad blocks.
So, this is why I rolled back. Probably the right approach will be to
add such blocks to the JFFS2 in-RAM bad block list but not mark them as
bad physically. But this is a distinct activity. I didn't explore this.
That "fix" slipped there accidentally. I didn't test it. So I removed
it. If you are energetic enough, work this problem out please :-)
--
Best Regards,
Artem B. Bityuckiy,
St.-Petersburg, Russia.
next parent reply other threads:[~2005-09-20 16:49 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <E1EHjUk-0001IT-Dn@phoenix.infradead.org>
[not found] ` <43303409.5030406@users.sourceforge.net>
2005-09-20 16:48 ` Artem B. Bityutskiy [this message]
2005-09-20 19:49 ` mtd/fs/jffs2 erase.c,1.84,1.85 roll back Anders Grafstrom
2005-09-22 14:34 ` Artem B. Bityutskiy
2005-09-23 15:22 ` Anders Grafstrom
2005-09-25 12:54 ` Jörn Engel
2005-09-26 8:03 ` Artem B. Bityutskiy
2005-09-26 8:31 ` Jörn Engel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=43303D59.1040805@yandex.ru \
--to=dedekind@yandex.ru \
--cc=grfstrm@users.sourceforge.net \
--cc=linux-mtd@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox