From: sl@gateway.fireplug.net (Stuart Lynne)
To: mtd@infradead.org
Subject: Re: [Fwd: Power Down]
Date: 20 Dec 1999 04:22:39 GMT [thread overview]
Message-ID: <83kauf$87s$1@nero.fireplug.net> (raw)
In-Reply-To: 384FC311.1E57CBD6@go2fax.com
In article <384FC311.1E57CBD6@go2fax.com>, Bob Canup <rcanup@go2fax.com> wrote:
>Bob Canup wrote:
>
>> Vipin Malik wrote:
>>
>> > Bob Canup wrote:
>> > >
>> >
>> I can't see any difference between erasing a bad sector after the next power
>> up and the case of a slightly earlier power failure where the data was never
>> written in the first place; you wind up with an identical file system in both
>> cases. If you can survive the case of the earlier power failure failing to
>> record the sector then you can survive the case of the bad sector being
>> erased.
>>
>> The only difference that I see is that in the case of the bad sector you
>> know something happened, in the case of the data never being recorded you
>> don't.
>>
>> To unsubscribe, send "unsubscribe mtd" to majordomo@infradead.org
>
>On the way home last night it occurred to me that if you are doing a
>read-modify-write cycle that it does make a difference where the error occurs.
>In this case if the sector is never written the old data is still valid.
>
>It seems to me the wear leveling necessary in a flash can be a benefit here; if
>I understand correctly we don't overwrite the physical pages - only when a page
>is 'committed' does the chip change its mapping so that it appears that the
>sector was overwritten.
The typical algorithm for writing new blocks into a flash system emulating a
disk device assumes that for each block you can store you have a logical
sector number and status.
- find an empty block
- write your data into it
- update the old data block status to say the logical block is being moved
- update the new data block status to show where the logical block now is
- update the old data block status to invalidate the entry
- start a sector erase if you need to
To read a block you look for a entry that shows the new location. If you can't find
one but did find one that was marked as being moved you fall back to that.
This gets complicated because you have to handle both sector erases and
block writes not completing from power failures. Which probably means that
you don't want to do anything to freshly erased sectors. I.e. a freshly
erased sector is identified simply because it is in its default erased
state. You can't dedicate sectors to any particular use (because you need to
load balance).
--
Stuart Lynne <sl@fireplug.net> __O
<http://www.thinlinux.org> _-\<,_ 604-461-7532
PGP Fingerprint: 28 E2 A0 15 99 62 9A 00 (_)/ (_) 88 EC A3 EE 2D 1C 15 68
To unsubscribe, send "unsubscribe mtd" to majordomo@infradead.org
next prev parent reply other threads:[~1999-12-20 4:19 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-12-08 21:36 [Fwd: Power Down] Vipin Malik
1999-12-08 23:02 ` Bob Canup
1999-12-09 11:02 ` David Woodhouse
1999-12-09 14:56 ` Bob Canup
1999-12-20 4:22 ` Stuart Lynne [this message]
-- strict thread matches above, loose matches on Subject: below --
1999-12-08 21:39 Vipin Malik
1999-12-08 21:32 Vipin Malik
1999-12-09 11:10 ` David Woodhouse
1999-12-08 20:48 Vipin Malik
1999-12-08 20:42 Vipin Malik
1999-12-07 16:36 [Fwd: power down] Oron Ogdan
1999-12-06 23:41 Vipin Malik
1999-12-07 15:47 ` Bob Canup
1999-12-20 4:03 ` Stuart Lynne
1999-12-07 20:36 ` Jon Burford
1999-12-13 14:49 ` Adi Linden
1999-12-13 19:07 ` Jon Burford
1999-12-08 15:10 ` David Woodhouse
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='83kauf$87s$1@nero.fireplug.net' \
--to=sl@gateway.fireplug.net \
--cc=mtd@infradead.org \
--cc=sl@fireplug.net \
/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