<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/mtd/ubi/eba.c, branch v2.6.39-rc2</title>
<subtitle>Linux Kernel (branches are rebased on master from time to time)</subtitle>
<id>https://sre.ring0.de/linux/atom?h=v2.6.39-rc2</id>
<link rel='self' href='https://sre.ring0.de/linux/atom?h=v2.6.39-rc2'/>
<link rel='alternate' type='text/html' href='https://sre.ring0.de/linux/'/>
<updated>2010-10-19T14:19:57Z</updated>
<entry>
<title>UBI: preserve corrupted PEBs</title>
<updated>2010-10-19T14:19:57Z</updated>
<author>
<name>Artem Bityutskiy</name>
<email>Artem.Bityutskiy@nokia.com</email>
</author>
<published>2010-09-03T20:08:15Z</published>
<link rel='alternate' type='text/html' href='https://sre.ring0.de/linux/commit/?id=5fc01ab6934c43b42c41bc753fe1123c16d7f38f'/>
<id>urn:sha1:5fc01ab6934c43b42c41bc753fe1123c16d7f38f</id>
<content type='text'>
Currently UBI erases all corrupted eraseblocks, irrespectively of the nature
of corruption: corruption due to power cuts and non-power cut corruption.
The former case is OK, but the latter is not, because UBI may destroy
potentially important data.

With this patch, during scanning, when UBI hits a PEB with corrupted VID
header, it checks whether this PEB contains only 0xFF data. If yes, it is
safe to erase this PEB and it is put to the 'erase' list. If not, this may
be important data and it is better to avoid erasing this PEB. Instead,
UBI puts it to the corr list and moves out of the pool of available PEB.
IOW, UBI preserves this PEB.

Such corrupted PEB lessen the amount of available PEBs. So the more of them
we accumulate, the less PEBs are available. The maximum amount of non-power
cut corrupted PEBs is 8.

This patch is a response to UBIFS problem where reporter
(Matthew L. Creech &lt;mlcreech@gmail.com&gt;) observes that UBIFS index points
to an unmapped LEB. The theory is that corresponding PEB somehow got
corrupted and UBI wiped it. This patch (actually a series of patches)
tries to make sure such PEBs are preserved - this would make it is easier
to analyze the corruption.

Signed-off-by: Artem Bityutskiy &lt;Artem.Bityutskiy@nokia.com&gt;
</content>
</entry>
<entry>
<title>UBI: rename IO error code</title>
<updated>2010-10-19T14:19:56Z</updated>
<author>
<name>Artem Bityutskiy</name>
<email>Artem.Bityutskiy@nokia.com</email>
</author>
<published>2010-09-02T22:30:16Z</published>
<link rel='alternate' type='text/html' href='https://sre.ring0.de/linux/commit/?id=756e1df1d2b8b572a92dd1b82d2a432d5b280b1c'/>
<id>urn:sha1:756e1df1d2b8b572a92dd1b82d2a432d5b280b1c</id>
<content type='text'>
Rename UBI_IO_BAD_HDR_READ into UBI_IO_BAD_HDR_EBADMSG which is presumably more
self-documenting and readable. Indeed, the '_READ' suffix does not tell much and
even confuses, while '_EBADMSG' tells about uncorrectable ECC error, because we
use -EBADMSG all over the place to represent ECC errors.

Signed-off-by: Artem Bityutskiy &lt;Artem.Bityutskiy@nokia.com&gt;
</content>
</entry>
<entry>
<title>UBI: do not warn unnecessarily</title>
<updated>2010-08-02T04:21:19Z</updated>
<author>
<name>Artem Bityutskiy</name>
<email>Artem.Bityutskiy@nokia.com</email>
</author>
<published>2010-07-30T11:59:50Z</published>
<link rel='alternate' type='text/html' href='https://sre.ring0.de/linux/commit/?id=64d4b4c90a876401e503c3a3260e9d0ed066f271'/>
<id>urn:sha1:64d4b4c90a876401e503c3a3260e9d0ed066f271</id>
<content type='text'>
Currently, when UBI attaches an MTD device and cannot reserve all 1% (by
default) of PEBs for bad eraseblocks handling, it prints a warning. However,
Matthew L. Creech &lt;mlcreech@gmail.com&gt; is not very happy to see this warning,
because he did reserve enough of PEB at the beginning, but with time some
PEBs became bad. The warning is not necessary in this case.

This patch makes UBI print the warning
 o if this is a new image
 o of this is used image and the amount of reserved PEBs is only 10% (or less)
   of the size of the reserved PEB pool.

Signed-off-by: Artem Bityutskiy &lt;Artem.Bityutskiy@nokia.com&gt;
</content>
</entry>
<entry>
<title>UBI: introduce a new IO return code</title>
<updated>2010-06-04T08:30:42Z</updated>
<author>
<name>Artem Bityutskiy</name>
<email>Artem.Bityutskiy@nokia.com</email>
</author>
<published>2010-05-03T06:04:39Z</published>
<link rel='alternate' type='text/html' href='https://sre.ring0.de/linux/commit/?id=eb89580e1a8388d206bf143c6c39d001095106ba'/>
<id>urn:sha1:eb89580e1a8388d206bf143c6c39d001095106ba</id>
<content type='text'>
This patch introduces the %UBI_IO_BAD_HDR_READ return code for
the I/O level function. We will use this code in order to distinguish
between "corrupted header possibly because this is non-ubi data" and
"corrupted header possibly because of real data corruption and ECC error".

So far this patch does not introduce any functional change, just a
preparation.

This patch is pased on a patch from
Sebastian Andrzej Siewior &lt;sebastian@breakpoint.cc&gt;

Signed-off-by: Artem Bityutskiy &lt;Artem.Bityutskiy@nokia.com&gt;
Reviewed-by: Sebastian Andrzej Siewior &lt;sebastian@breakpoint.cc&gt;
Tested-by: Sebastian Andrzej Siewior &lt;sebastian@breakpoint.cc&gt;
</content>
</entry>
<entry>
<title>UBI: simplify IO error codes</title>
<updated>2010-06-04T08:30:42Z</updated>
<author>
<name>Artem Bityutskiy</name>
<email>Artem.Bityutskiy@nokia.com</email>
</author>
<published>2010-04-30T13:50:22Z</published>
<link rel='alternate' type='text/html' href='https://sre.ring0.de/linux/commit/?id=786d78318586cbdc8aec539fe5a4942490267fef'/>
<id>urn:sha1:786d78318586cbdc8aec539fe5a4942490267fef</id>
<content type='text'>
We do not really need 2 separate error codes for indicating bad VID
and bad EC headers (UBI_IO_BAD_EC_HDR, UBI_IO_BAD_VID_HDR), it is
enough to have only one UBI_IO_BAD_HDR return code.

This patch does not introduce any functional change, only some
code simplification.

Signed-off-by: Artem Bityutskiy &lt;Artem.Bityutskiy@nokia.com&gt;
Reviewed-by: Sebastian Andrzej Siewior &lt;sebastian@breakpoint.cc&gt;
Tested-by: Sebastian Andrzej Siewior &lt;sebastian@breakpoint.cc&gt;
</content>
</entry>
<entry>
<title>trivial: fix typo "to to" in multiple files</title>
<updated>2009-09-21T13:14:55Z</updated>
<author>
<name>Anand Gadiyar</name>
<email>gadiyar@ti.com</email>
</author>
<published>2009-07-16T15:13:03Z</published>
<link rel='alternate' type='text/html' href='https://sre.ring0.de/linux/commit/?id=fd589a8f0a13f53a2dd580b1fe170633cf6b095f'/>
<id>urn:sha1:fd589a8f0a13f53a2dd580b1fe170633cf6b095f</id>
<content type='text'>
Signed-off-by: Anand Gadiyar &lt;gadiyar@ti.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</content>
</entry>
<entry>
<title>UBI: fix double free on error path</title>
<updated>2009-07-24T17:08:52Z</updated>
<author>
<name>Adrian Hunter</name>
<email>Adrian.Hunter@nokia.com</email>
</author>
<published>2009-07-24T14:05:00Z</published>
<link rel='alternate' type='text/html' href='https://sre.ring0.de/linux/commit/?id=7194e6f9c083e87171ddfc8b746f05e007f58132'/>
<id>urn:sha1:7194e6f9c083e87171ddfc8b746f05e007f58132</id>
<content type='text'>
If we fail in 'ubi_eba_init_scan()', we free
'ubi-&gt;volumes[i]-&gt;eba_tbl' in there, but also later free it
in 'free_internal_volumes()'. Fix this by assigning NULL
to 'ubi-&gt;volumes[i]-&gt;eba_tbl' after it is freed.

Signed-off-by: Adrian Hunter &lt;adrian.hunter@nokia.com&gt;
Signed-off-by: Artem Bityutskiy &lt;Artem.Bityutskiy@nokia.com&gt;
</content>
</entry>
<entry>
<title>UBI: handle more error codes</title>
<updated>2009-06-10T13:13:28Z</updated>
<author>
<name>Artem Bityutskiy</name>
<email>Artem.Bityutskiy@nokia.com</email>
</author>
<published>2009-06-10T08:32:05Z</published>
<link rel='alternate' type='text/html' href='https://sre.ring0.de/linux/commit/?id=6b5c94c6b4e1630a8e1ee7d30383d9396603749f'/>
<id>urn:sha1:6b5c94c6b4e1630a8e1ee7d30383d9396603749f</id>
<content type='text'>
The UBIFS WL worker may encounter read errors and there is logic
which makes a decision whether we should do one of:

1. cancel the operation and move the PEB with the read errors to
   the 'erroneous' list;
2. switch to R/O mode.

ATM, only -EIO errors trigger 1., other errors trigger 2. The idea
is that if we know we encountered an I/O error, do 1. Otherwise,
we do not know how to react, and do 2., just in case. E.g., if
the underlying driver became crazy because of a bug, we do not
want to harm any data, and switch to R/O mode.

This patch does 2 things:
1. Makes sure reads from the source PEB always cause 1. This is
   more consistent with other reads which come from the upper
   layers and never cause R/O.
2. Teaches UBI to do 1. also on -EBADMSG, UBI_IO_BAD_VID_HDR,
   -ENOMEM, and -ETIMEOUT. But this is only when reading the
   target PEB.

This preblems were hunted by Adrian Hunter.

Signed-off-by: Artem Bityutskiy &lt;Artem.Bityutskiy@nokia.com&gt;
</content>
</entry>
<entry>
<title>UBI: fix multiple spelling typos</title>
<updated>2009-06-10T13:13:27Z</updated>
<author>
<name>Artem Bityutskiy</name>
<email>Artem.Bityutskiy@nokia.com</email>
</author>
<published>2009-06-08T16:28:18Z</published>
<link rel='alternate' type='text/html' href='https://sre.ring0.de/linux/commit/?id=815bc5f8fe516f55291aef90f2142073821e7a9c'/>
<id>urn:sha1:815bc5f8fe516f55291aef90f2142073821e7a9c</id>
<content type='text'>
Some of the typos were indicated by Adrian Hunter,
some by 'aspell'.

Signed-off-by: Artem Bityutskiy &lt;Artem.Bityutskiy@nokia.com&gt;
</content>
</entry>
<entry>
<title>UBI: do not switch to R/O mode on read errors</title>
<updated>2009-06-02T10:53:35Z</updated>
<author>
<name>Artem Bityutskiy</name>
<email>Artem.Bityutskiy@nokia.com</email>
</author>
<published>2009-05-24T11:13:34Z</published>
<link rel='alternate' type='text/html' href='https://sre.ring0.de/linux/commit/?id=b86a2c56e512f46d140a4bcb4e35e8a7d4a99a4b'/>
<id>urn:sha1:b86a2c56e512f46d140a4bcb4e35e8a7d4a99a4b</id>
<content type='text'>
This patch improves UBI errors handling. ATM UBI switches to
R/O mode when the WL worker fails to read the source PEB.
This means that the upper layers (e.g., UBIFS) has no
chances to unmap the erroneous PEB and fix the error.
This patch changes this behaviour and makes UBI put PEBs
like this into a separate RB-tree, thus preventing the
WL worker from hitting the same read errors again and
again.

But there is a 10% limit on a maximum amount of PEBs like this.
If there are too much of them, UBI switches to R/O mode.

Additionally, this patch teaches UBI not to panic and
switch to R/O mode if after a PEB has been copied, the
target LEB cannot be read back. Instead, now UBI cancels
the operation and schedules the target PEB for torturing.

The error paths has been tested by ingecting errors
into 'ubi_eba_copy_leb()'.

Signed-off-by: Artem Bityutskiy &lt;Artem.Bityutskiy@nokia.com&gt;
</content>
</entry>
</feed>
