]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commit
UBI: fix atomic LEB change problems
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Thu, 13 Sep 2007 11:28:14 +0000 (14:28 +0300)
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Sun, 14 Oct 2007 10:10:21 +0000 (13:10 +0300)
commite8823bd63d50bb1f9bd73f1197230e1f7217456a
tree3b8b849512686aebda99f83d290c9e09ed983967
parent6986646ba752fef150286926aa922ef04e9d19dd
UBI: fix atomic LEB change problems

When the UBI device is nearly full, i.e. all LEBs are mapped, we have
only one spare LEB left - the one we reserved for WL purposes. Well,
I do not count the LEBs which were reserved for bad PEB handling -
suppose NOR flash for simplicity. If an "atomic LEB change operation"
is run, and the WL unit is moving a LEB, we have no spare LEBs to
finish the operation and fail, which is not good. Moreover, if there
are 2 or more simultanious "atomic LEB change" requests, only one of
them has chances to succeed, the other will fail with -ENOSPC. Not
good either.

This patch does 2 things:
1. Reserves one PEB for the "atomic LEB change" operation.
2. Serealize the operations so that only on of them may run
   at a time (by means of a mutex).

Pointed-to-by: Brijesh Singh <brijesh.s.singh@gmail.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
drivers/mtd/ubi/eba.c
drivers/mtd/ubi/ubi.h