]> git.baikalelectronics.ru Git - kernel.git/commit
mtd: fix merge conflict resolution breakage
authorArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Wed, 1 Feb 2012 19:10:24 +0000 (11:10 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 1 Feb 2012 19:10:24 +0000 (11:10 -0800)
commit157a81d8f515edfbc51f7e9f1ca89cf78a8cc7c2
treea90bf478f8fe36543ba586db5fa2760ba129a180
parent5c4f9418d44bb5dea9aa3f015ada895716303915
mtd: fix merge conflict resolution breakage

This patch fixes merge conflict resolution breakage introduced by merge
afcc0725e2a9 ("Merge tag 'for-linus' of git://github.com/prasad-joshi/logfs_upstream").

The commit changed 'mtd_can_have_bb()' function and made it always
return zero, which is incorrect.  Instead, we need it to return whether
the underlying flash device can have bad eraseblocks or not.  UBI needs
this information because it affects how it handles the underlying flash.
E.g., if the underlying flash is NOR, it cannot have bad blocks and any
write or erase error is fatal, and all we can do is to switch to R/O
mode.  We do not need to reserve a pool of good eraseblocks for bad
eraseblocks handling, and so on.

This patch also removes 'mtd_can_have_bb()' invocations from Logfs to
ensure correct Logfs behavior.

I've tested that with this patch UBI works on top of NOR and NAND
flashes emulated by mtdram and nandsim correspondingly.

This patch is based on patch from Linus Torvalds.

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Acked-by: Jörn Engel <joern@logfs.org>
Acked-by: Prasad Joshi <prasadjoshi.linux@gmail.com>
Acked-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/logfs/dev_mtd.c
include/linux/mtd/mtd.h