MTD concat layer
Brian J. Fox
bfox at ua.com
Mon Feb 18 10:46:47 EST 2002
Date: Mon, 18 Feb 2002 09:48:51 +0100 (MET)
From: Robert Kaiser <rob at sysgo.de>
> In order to achieve predictable behavior, and fewer bugs in the driver
> overall, functions should simply refuse to operate on parameters that
> fall out-of-bounds, and should return an error which specifies why
> nothing happened.
Now, here comes the problem. In the context of an erase function,
what does "predictable behavior" mean ? If it returns EINVAL, the caller
can see that they passed a faulty parameter, so does it make any
difference wether some of the specified flash range have been erased in
the process?
Sure. Erasing the blocks *changes* the state of the world from a
predictable one to an unpredictable one.
By specifying a certain area of flash to be erased, the user has by
definition given up any hope of seeing the data in that area again.
If the arguments are invalid, the code that calculated them is
probably invalid. Erasing the blocks is simply mean, and irreversible.
I think one can compare this to a read() function: if read() returns
an error, would you expect that the buffer that you passed to it
still contains all of its previous data ?
It wouldn't matter if the buffer contained partial data, or no data,
or the previous data. You haven't done something that is user visibly
irreversible!
> Hab' ich meine Gedanken gut eklaren?
>
Ja. Ich meine auch ?
Ja, aber "read" ist nicht "delete"!
MBD,
Brian
== The Difference Between Cultures: ==
Einigkeit und Recht und Freiheit
Liberte', E'galite', Fraternite'
Sex, drugs and rock'n'roll
More information about the linux-mtd
mailing list